I am using sflistview to display list of items (uses samplelistviewmodel) and having a datatemplate for my viewcell (uses sampleitemviewmodel) .
Inside the view cell i have a grid , with a Tap gesture recoognizer .This recognizer would call a command from a samplelistviewmodel and pass the sampleitemviewmodel as a Commandparameter to that command .
<xForms:SfListView
Grid.Row="2"
SelectionBackgroundColor="Transparent"
BackgroundColor="#F0F4F7"
ItemSize="270"
ItemsSource="{Binding ItemList}"
>
<xForms:SfListView.ItemTemplate>
<DataTemplate>
<views: SampleViewCell />
DataTemplate>
xForms:SfListView.ItemTemplate>
xForms:SfListView>
My code snippet is as follows,
<ViewCell
x:Class=""
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls=""
xmlns:xamlMarkupExtensions=""
x:Name="SampleViewCell"
>
<ViewCell.View >
Command="{Binding Source={x:Reference SampleViewCell}, Path=Parent.BindingContext.SampleCommand}"
CommandParameter="{Binding Source={x:Reference SampleViewCell}, Path=BindingContext}"
ViewCell.View >
However the same works , when i try with listview it works , while with sflitview it doesnt.Please help