Silverlight Windows Phone 7: Gesture events?

霸气de小男生 提交于 2019-12-23 15:01:50

问题


I'm mocking up a wp7 app in Expression Blend and looking for set up an event handler in response to certain gestures. Some Bing-ing shows some people recommending to use "on click" or something and check the time between taps oneself, but it seems like there should be an easier way.

Is there an event for Silverlight controls that fires for gestures (or specific types of gestures?)


回答1:


Silverlight for Windows Phone 7 doesn't natively contain any support for gestures. However, there are a number of options available:

The Silverlight for Windows Phone Toolkit contains a GestureService/GestureListener which I'd recommend looking at first.

Laurent Bugnion has created some MultiTouch behaviours which may be of interest, dependeing on your specific requirements.

A final option would be to use some of the gestures supported by the XNA Framework. Mike Ormond has written a good introduction to using them.

Beyond that you'll have to detect/determine gestures yourself through use of the ManipulationStarted, ManipulationDelta and ManipulationCompleted events. MSDN also has a guide to handling manipulation events which you could also use as a pointer to detecting gestures yourself.



来源:https://stackoverflow.com/questions/3936185/silverlight-windows-phone-7-gesture-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!