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

Changing a default page

By default, the automatically added page is shown after you launch the application. However, you may want to start with another page. Of course, such a change is possible and does not require significant modifications. You will learn how to do it in this recipe.

Getting ready

To step through this recipe, you need a project with two pages, represented by the MainPage and DefaultPage classes. Of course, you should manually add the second one.

How to do it...

To change a default page, shown when the application is launched, you need to perform the following steps:

  1. Open the App.xaml.cs file by expanding the App.xaml node in the Solution Explorer window and double-clicking on App.xaml.cs.
  2. Take the line in the OnLaunched method (line ...

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