Gesture Support

Gesture support has been implemented with the intent of providing parity with the GestureService/GestureListener provided in the Silverlight for Windows Phone Toolkit, available at http://silverlight.codeplex.com/

The typical way to use the gesture behavior to the desired control is in the Xaml markup itself, as seen below:
<Rectangle Fill="Blue" Width="100" Height="100">
	<Touch:GestureService.GestureListener>
		<Touch:GestureListener 
			Tap="GestureListener_Tap" 
			DragStarted="GestureListener_DragStarted" 
			DragDelta="GestureListener_DragDelta"
			DragCompleted="GestureListener_DragCompleted"
			DoubleTap="GestureListener_DoubleTap"
			Hold="GestureListener_Hold"/>
	</Touch:GestureService.GestureListener>
</Rectangle>

The majority of the gesture-specific events provide an instance of the GestureEventArgs class, which includes:
  • GestureOrigin - the point (in screen coordinates) where the gesture originated
  • The GetPosition method - allows the return of a the GestureOrigin value in coordinates relative to the provided UIElement

The events specific to dragging also return additional information.

Last edited Apr 3, 2011 at 2:52 AM by avidgator, version 2

Comments

No comments yet.