May 2013
Intermediate to advanced
1152 pages
82h 34m
English
The following example shows how to change the color of a Border control by responding to the Touch.FrameReported event. Within the TouchPointView XAML file is a named Border control as shown:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <Border x:Name="border" Height="100" Width="200" Background="{StaticResource PhoneAccentBrush}" /></Grid>
The code-beside file, TouchPointView.xaml.cs, subscribes to the Touch.FrameReported event within the page constructor. The event handler retrieves the primary touch point, and if the TouchPoint is above the Border, the Border object’s Background is switched (see Listing 12.2).
LISTING 12.2. TouchPointView ...
Read now
Unlock full access