Monday, October 28, 2024
HomeComputer programmingC programmingChange the Default XAML Page in a Windows Phone App

Change the Default XAML Page in a Windows Phone App

When creating a Windows phone application, Visual Studio defaults the initial page to MainPage.xaml. However, in many cases, developers need to customize the first loaded page to a different file instead.

At times, a developer may focus so much on the main content of an app that he forgets about small, extra pages like the splash screen or the tutorial page. In this case, adding another XAML page, configuring it to be the first loaded page, and letting users enter the main app page from there is a good idea.

Let us walk through the steps to change the default XAML page to a different file:

1. Launch Visual Studio, and open the solution for which you want to change the default XAML page.

2. In the Solution Explorer window, navigate to Properties, and double-click on the WMAppManifest.xml file.

3. In the WMAppManifest.xml file, find this line: <DefaultTask Name =”_default” NavigationPage=”MainPage.xaml”/>

4. Replace MainPage.xaml with the XAML page’s name that you want to be the default one. In this case, I replace MainPage.xaml with Menu.xaml. If you are not sure about the page’s name, you can look it up in the Solution Explorer window.

5. Save the xml file.

 

Lê Hoàng
Lê Hoàng
When not creating exciting new Android games, Lê Hoàng is here crafting tutorials, tweaks, and fixes for your enjoyment.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!