The last touch event, analyzed in this chapter, is rotation. It is very useful, for example, to rotate the image, as you will see in this recipe.
To prepare the example that handles the rotate touch event to rotate the image presented on the page, perform the following steps:
Add the
Photo.jpg
file to theAssets
directory.Add an image to the page, support the necessary manipulation modes, and define a rotation transform. Do this by modifying the content of the
MainPage.xaml
file, as follows:<Page (...)> <Grid> <Image Source="/Assets/Photo.jpg" ImageOpened="Image_ImageOpened" ManipulationMode="Rotate,RotateInertia" ManipulationDelta="Image_ManipulationDelta" Stretch="UniformToFill"> ...