Page Navigation In Windows Phone 8

In Windows Phone 8 applications, the NavigationService class is used to navigate between application pages.

To navigate to a new page, call the .Navigate() method:

NavigationService.Navigate(
  new Uri("/Pages/AboutPage.xaml", UriKind.Relative));

The Navigate() method takes 2 parameters. The first being the page to navigate to. I like to keep my pages in a subfolder “/Pages” to keep them organized.

The second parameter specifies whether the Uri is relative or absolute. In the example above, the Uri is relative to the application’s structure, i.e. the AboutPage.xaml file can be found in the /Pages folder located of the application’s source root.

If required, an application can navigate backwards from a page, gain using the NavigationService class.

NavigationService.GoBack();
This entry was posted in Development, Windows Phone and tagged , . Bookmark the permalink.

Leave a comment