-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Windows Application Development Cookbook
By :
In the previous recipes, you learned how to handle the event of tapping a control placed on a page. However, in this recipe, you will learn how to get an exact location where the user tapped the canvas, taking into account the multi-touch feature.
As an example, you will create a page with the Canvas control. After tapping it, an ellipse should be drawn in such a place. Of course, in the case of multi-touch, more than one shape will be added at the same time.
To step through this recipe, you need only the automatically generated project.
To prepare the example that handles the tap touch event and adds an ellipse in each pressed location, perform the following steps:
Add a canvas (where the ellipses will be drawn) to the page by modifying the content of the MainPage.xaml file, as follows:
<Page (...)>
<Grid>
<Canvas
x:Name="Canvas"
Background...