O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Capturing User Input

The touch related events, MouseLeftButtonDown, MouseMove, and MouseLeftButtonUp, are used to collect and display strokes in the InkPresenter while the user interacts with the control. The following excerpt shows an InkPresenter with subscriptions to the three mouse events:

<Grid x:Name="ContentPanel" Grid.Row="1">    <InkPresenter Strokes="{Binding Strokes}"        VerticalAlignment="Stretch"        Background="Black"        MouseMove="InkPresenter_MouseMove"        MouseLeftButtonDown="InkPresenter_MouseLeftButtonDown"        MouseLeftButtonUp="InkPresenter_MouseLeftButtonUp" /></Grid>

Note

The Background property of the InkPresenter must be assigned to register Mouse events.

Listing 7.1 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required