Windows Phone 8.1 and Windows Runtime Apps How to #13 – How to Change the Start Page of the App ?

When you create a Windows Phone 8.1 app in Visual Studio 2013 , the MainPage.xaml is set as the default start page of the app . Sometimes , you might want to change the start page of the Windows Phone 8.1 App from MainPage.xaml to a different page.

How to Change the Start Page of the Windows Phone 8.1 App (Windows Runtime App) ?

To change the start page of the Windows Phone 8.1 app , follow the below steps.

1. Open the Windows Phone 8.1 Project in Visual Studio 2013 .Double click the App.xaml.cs file from solution explorer.

2. The App.xaml.cs contains the Onlaunched event where the start page is defined . By Default , the MainPage is the start page of the application.

image

3. Create a new xaml page from solution explorer and name it as “NewMobileOSGeekPage.xaml” . Now , replace “MainPage” with the NewMobileOSGeekPage in the OnLaunched event page .

if (!rootFrame.Navigate(typeof(NewMobileOSGeekPage), e.Arguments))
{
   throw new Exception("Failed to create initial page");
}

Build and run your app on the Windows Phone 8.1 emulator . You should see the app running with the new start page that is set.

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...