How to call EventToCommand from GestureListener.Gesture

Has anyone used Toolkit.GestureListener to fire EventToCommand?

+4
source share
2 answers

I don't think you can do this with the EventToCommand behavior, but I created a behavior that makes it easy to add a GestureListener by linking them to the team.

<Button Content="Start" Behaviour:GestureListenerBehaviours.TapCommand="{Binding StartCommand}" /> 

I just matched the tap and the double tap, but if necessary, you need to easily display the rest. Check out this link for source code.

http://lazycowprojects.tumblr.com/post/10397441921/gesturelistenerbehaviourswp7

+1
source

This is currently not possible. GestureListener.Tap does not support this. I have an event handler in my code that calls the viewmodel method using datacontext:

  private void OnListItemTap(object sender, GestureEventArgs e) { var vm = DataContext as MyViewModel; if (vm != null) { vm.TapOnItem.Execute(listbox.SelectedItem); } } 
0
source

All Articles