Understanding events
If you have done some programming in the past, you should find yourself very comfortable using an event. Events are a simple way of saying "something happened" against which you can write the code to handle it. A very classic type of event is handling an OnClick event where a user clicks a button or in the case of Windows Phone, a user touches a button. In our first example, we will carry out a very basic handling of this event type.
Getting ready
To get started with this example, create a very basic windows phone application in Visual Studio like we have in the previous chapters. This will just be the standard windows phone application type, as shown in the following screenshot:
How to do it...
Now that we have a simple starting point we can begin to implement behaviors.
1. Let's change the XAML for the content panel to the following:
<!--ContentPanel - place additional content here--> <StackPanel x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <Button...