Is there a high level replacement for the WP7 Toolkit GestureService?

馋奶兔 提交于 2019-12-11 19:18:22

问题


I currently use the WP7 tookit's GestureService in a few of my applications in order to perform Flick and Pinch/Zoom gestures on Silverlight UI elements. However, seeing that the service has been deprecated, I am trying to find a replacement library that can do the perform all the low level calculations in a similar fashion.

I've been reading that hooking into ManipulationDelta is the way to go, but I'd rather not delve into that if I don't have to - is there an alternative that anyone is aware of?


回答1:


you can use ManipulationStarted, ManipulationDelta and ManipulationCompleted - which are high level. you can also use Touch.FrameReported - which provides a low-level interface on user touch

http://invokeit.wordpress.com/2012/04/27/high-performance-touch-interface-wpdev-wp7dev/

I use GestureService instead of rolling my own for pinch zoom, flick and drag

Found some more stuff that can be used to replace gesture service.

// Scale the rectangle.
this.scale.ScaleX *= e.DeltaManipulation.Scale.X;
this.scale.ScaleY *= e.DeltaManipulation.Scale.Y;

// Move the rectangle.
this.translation.X += e.DeltaManipulation.Translation.X;
this.translation.Y += e.DeltaManipulation.Translation.Y;

More on it here http://msdn.microsoft.com/en-us/library/ff426933(v=vs.95).aspx



来源:https://stackoverflow.com/questions/10522499/is-there-a-high-level-replacement-for-the-wp7-toolkit-gestureservice

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