Skip to content

Instantly share code, notes, and snippets.

@julesx
Created March 8, 2017 16:38
Show Gist options
  • Save julesx/07dd19850e1392d268245b4a07116cd8 to your computer and use it in GitHub Desktop.
Save julesx/07dd19850e1392d268245b4a07116cd8 to your computer and use it in GitHub Desktop.
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<views:ItemDetailsListView ItemTemplate="{StaticResource DataFieldCellTemplateSelector}" />
</ContentPage>
public partial class ItemDetailsListView : ContentView
{
public ItemDetailsListView()
{
InitializeComponent();
}
public static readonly BindableProperty ItemTemplateProperty = BindableProperty.Create("ItemTemplate", typeof(DataTemplate), typeof(ItemDetailsListView));
public DataTemplate ItemTemplate
{
get
{
return (DataTemplate)base.GetValue(ItemTemplateProperty);
}
private set
{
base.SetValue(ItemTemplateProperty, value);
}
}
}
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:behavior="clr-namespace:MyApp.Core.Behavior;assembly=MyApp.Core"
x:Class="MyApp.Core.Views.ItemDetailsListView" x:Name="MyItemDetailsListView">
<ListView ItemTemplate="{Binding Source={x:Reference MyItemDetailsListView}, Path=ItemTemplate}" />
</ContentView>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment