Is there a high level replacement for the WP7 Tool

2019-08-30 07:52发布

问题:

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