How can I add the GestureService and a handler for the Flick event in code-behind (i.e. not in XAML)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Firstly, make sure you’ve added a reference to the Silverlight Toolkit for Windows Phone 7, specifically the Microsoft.Phone.Controls.Toolkit.dll assembly. Then make sure you have an XML namespace reference for the Microsoft.Phone.Controls namespace:
Then, add the
GestureService.GestureListenerto the control you want to handle gestures on:Then you just need to implement your logic in the event handler.
Update: The above approach is for using the
GestureServicein XAML; to use theGestureServicein code-behind you use theGetGestureListenermethod: