I have a telerikDataControls:RadListView.ItemTemplateSelector working nicely.
<
telerikDataControls:RadListView.ItemTemplateSelector
>
<
vm:TodayCellSelector
AllDayTemplate
=
"{StaticResource AllDayCellTemplate}"
InspirationTemplate
=
"{StaticResource InspirationCellTemplate}"
ErrorTemplate
=
"{StaticResource ErrorCellTemplate}"
>
The templates are in separate files like this:
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<?
xaml-comp
compile
=
"true"
?>
<
ResourceDictionary
xmlns:telerikListView
=
"clr-namespace:Telerik.XamarinForms.DataControls.ListView;assembly=Telerik.XamarinForms.DataControls"
xmlns:x
=
"http://schemas.microsoft.com/winfx/2009/xaml"
>
<
DataTemplate
x:Key
=
"ErrorCellTemplate"
>
<
telerikListView:ListViewTemplateCell
>
<
telerikListView:ListViewTemplateCell.View
>
<
Label
Text
=
"ERROR"
></
Label
>
</
telerikListView:ListViewTemplateCell.View
>
</
telerikListView:ListViewTemplateCell
>
</
DataTemplate
>
</
ResourceDictionary
>
Problem: I need to call an ICommand on the parent Page from the Cell. How do I reference the page? I tried to give the page a x:Name and try that in the Binding on the Cell, but the compiler throws an error that it can't find the Page.
The cell, if placed in the main page works fine, but the cells are huge so I want them in separate files to manage.
TappedCommand="{Binding Source={x:Reference MyPage}, Path=BindingContext.EventDetailCommand}"