Skip to main content
Version: 11.0.0

Gestures

Controls can detect gestures using Gesture Recognizers. These recognizers are hosted in controls, and listen for and track pointer events that the control receives, sending gesture events when they have detected a gesture has started.

All gesture recognizers derive from the base class GestureRecognizer, and can be attached to a control using the control's GestureRecognizers property. The following shows an Image hosting a ScrollGestureRecognizer;

<Image Stretch="UniformToFill"
Margin="5"
Name="image"
Source="/image.jpg">
<Image.GestureRecognizers>
<ScrollGestureRecognizer CanHorizontallyScroll="True"
CanVerticallyScroll="True"/>
</Image.GestureRecognizers>
</Image>
C#
image.GestureRecognizers.Add(new ScrollGestureRecognizer()
{
CanVerticallyScroll = true,
CanHorizontallyScroll = true,
});

More Information

info

You can view more information on the available gesture recognizers here

You can view the source for related classes

GestureRecognizer

GestureRecognizerCollection