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

In this post, you will learn about sync provider notifications in Windows 11 and how to disable or enable it...
In this tutorial, let’s learn how to enable or disable the startup sound in Windows 11. By default, when Windows...
The CameraCaptureTask allows the Windows Phone 7 App to launch the Camera Application . This will be useful when the...