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’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...