O'Reilly logo

Windows Application Development Cookbook by Marcin Jamro

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

Handling events

Apart from adding controls to the page, it is necessary to introduce interaction with them, such as performing some actions after clicking on a button or choosing an item from a drop-down list. In this recipe, you will learn how to handle the event of pressing the button.

Getting ready

To use this recipe, you need the project from the previous recipe. It should contain the MainPage.xaml file with the added button.

How to do it...

To handle the Click event, you need to perform the following steps:

  1. Double-click on the MainPage.xaml file in the Solution Explorer window.
  2. To generate a method that handles the situation of the button being pressed, double-click on the added button. Alternatively, click on the button (either in a graphical ...

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