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 ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.