How to Navigate from One Page to Another in Windows Phone using C# ?

The Navigation to different pages in Windows Phone is handled with the NavigationService Property defined in the PhoneApplicationPage class.

To perform an external Navigation , you should be using the HyperlinkButton or other Launchers that helps you to Navigate to an external URL . You can use the property NavigationService to Navigate to different pages with in your Windows Phone Application.

How to Navigate from One Page to Another in Windows Phone using C# ?

The NavigationService includes a method Navigate which lets you navigate to a specified Windows Phone page.

For example , if you want to navigate to page1.xaml from the MainPage.xaml , you could add the following code in the Mainpage.xaml.

private void button1_Click(object sender, RoutedEventArgs e)
{
     NavigationService.Navigate(new Uri("/Page1.xaml", UriKind.Relative));
}

You can also use the property NavigationService.Source to specify the URI page to be navigated to .

private void button1_Click(object sender, RoutedEventArgs e)
{
     NavigationService.Source = new Uri("/Page1.xaml", UriKind.Relative);
 //  NavigationService.Navigate(new Uri("/Page1.xaml", UriKind.Relative));
}
How to Navigate from One Page to Another in Windows Phone using C# ?
How to Navigate from One Page to Another in Windows Phone using C# ?

Leave A Reply

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

You May Also Like

This blog post will guide you through several effective methods to troubleshoot and resolve the issue of Microsoft Edge not...
Windows 11 offers a range of audio enhancements that can enrich your listening experience. These enhancements include features like virtual...
Windows 11 brings a fresh and visually stunning design to your desktop, and one of the standout features is the...