Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to Add a Tap Gesture Recognizer to a Frame that is inside a ViewCell?

$
0
0

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>

And on the view model i have

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?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>