When you are creating any new Universal Windows Application, Visual Studio defaults start the MainPage.xaml. Here we will have a look at how to change it to a custom page according to the user choice.
Step 1: Open Visual Studio and add a new page to your project by right clicking your Project Add a New Item
Step 2: Add a new Blank Page. You can give your custom name for the App. Here I have given a name myNewPage
Here for understanding I have changed the background color of my new page to light blue.
Step 3: Open the App.xaml.cs page and find the following code
- if (e.PrelaunchActivated == false)
- {
- if (rootFrame.Content == null)
- {
-
-
-
- rootFrame.Navigate(typeof(MainPage), e.Arguments);
- }
-
- Window.Current.Activate();
- }
Step 4: Here change the MainPage to your new Page name
Step 5: Run and Test your Application