So i am trying to add a Tap Gesture Recognizer to a Frame that is inside a ViewCell:
<ListView ItemsSource="{Binding MyList}" RowHeight="200" SeparatorVisibility="None" >
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Frame Margin="20, 10, 20, 5" Padding="0" HasShadow="true" CornerRadius="0>
<Frame.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding TapCardCommand}"
CommandParameter="{Binding Name}"
/>
</Frame.GestureRecognizers>
/* Content of frame */
</Frame>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
public ObservableCollection<MyObject> MyList { get; set; }
public ICommand TapCardCommand { get; set; }
public ViewModel()
{
TapCardCommand = new Command(ChangePage);
}
private void ChangePage(object obj)
{
MessagingCenter.Send(obj, "ChangePage");
}
But when i click in the frame the ChangePage method is not being called. What am i doing wrong?