none
Startup Page of an Metro Style APP

    Question

  • hello,

    I would like to know how to set up a startup page of an application.

    IN WPF apps,it's done by setting up the startupuri to my page.

    How do i do it in Metro Style APP?

    Sunday, August 26, 2012 8:22 PM

Answers

  • Click on the arrow in front of App.xaml in Visual Studio Solution Explorer to expand the node. Then open App.xaml.cs and change the Page you want to open as the default Page. In a project generated from the built-in templates search for the text MainPage in App.xaml.cs. The following code in App.xaml.cs is of interest.

    // When the navigation stack isn't restored navigate to the first page,
    // configuring the new page by passing required information as a navigation
    // parameter
    if (!rootFrame.Navigate(typeof(MainPage), args.Arguments))
    {
      throw new Exception("Failed to create initial page");
    }

    • Marked as answer by Rajiv Prathap Sunday, August 26, 2012 9:04 PM
    Sunday, August 26, 2012 8:58 PM

All replies

  • In C# and VB.NET Windows Store Apps its defined in the code behind of App.xaml. In JavaScript applications you have to edit your Package manifest by double clicking on it in the Solution Explorer.
    Sunday, August 26, 2012 8:43 PM
  • Hi Paul,

    How to code that in App.xaml?

    Sunday, August 26, 2012 8:52 PM
  • Click on the arrow in front of App.xaml in Visual Studio Solution Explorer to expand the node. Then open App.xaml.cs and change the Page you want to open as the default Page. In a project generated from the built-in templates search for the text MainPage in App.xaml.cs. The following code in App.xaml.cs is of interest.

    // When the navigation stack isn't restored navigate to the first page,
    // configuring the new page by passing required information as a navigation
    // parameter
    if (!rootFrame.Navigate(typeof(MainPage), args.Arguments))
    {
      throw new Exception("Failed to create initial page");
    }

    • Marked as answer by Rajiv Prathap Sunday, August 26, 2012 9:04 PM
    Sunday, August 26, 2012 8:58 PM