In This Chapter
Using mouse events for tap and double-tap gestures
Understanding how touch events are promoted to mouse events
Registering for touch notifications using the Touch.FrameReported
event
Using manipulation events to consolidate touch input from multiple fingers
Using a RenderTransform
to move, resize, and rotate a UIElement
via touch
Animating an element in response to a flick gesture
Best practices when designing touch friendly interfaces
Windows Phone devices come equipped with capacitive touch screens that offer a smooth, accurate, multitouch enabled experience. By adding touch and gesture support to your apps, you can greatly enhance the user experience.
You can handle touch input in your XAML-based Windows Phone app in a number of ways, including
Mouse events
TouchPoint
class
Manipulation events
UIElement
gesture events
Windows Phone Toolkit for gestures
Mouse events are an easy way to get basic touch support and detect simple, one-finger gestures, such as tap and double tap.
The TouchPoint
class provides a low-level input system that you can use to respond to all touch activity in the UI. The TouchPoint
class is used by the higher-level touch input systems.
Manipulation events are UIElement
events used to handle more complex gestures, such as multitouch gestures and gestures that use inertia and velocity data.
UIElement
and Toolkit gestures further consolidate the low-level touch API into a set of gesture-specific events and make it easy to handle complex single and multitouch gestures.
This chapter explores each of these four approaches in detail. The chapter presents an example app demonstrating how to move, resize, rotate, and animate a UIElement
using gestures; and it concludes by looking at the best practices for optimizing your user interfaces for touch input.
Note
The Windows Phone Emulator does not support multitouch input using the mouse, therefore multitouch apps must be tested on a development computer that supports touch input, or on an actual phone device.
3.136.18.48