There are couple of ways of navigating between different pages in a windows phone application. These are:
1) By using NavigationService.Navigate method.
2) By using Frame.Navigate method.
Frame.Navigate Method
This method is very simple and in this tutorial i have done navigation between pages using this method.
Steps:
1) Open Visual Studio 2013 and select WP 8.1 Blank App under C# and name it PageNavigation.
2) In Solution Explorer, right click on the project and Add New Blank Page.
3) Name the new page as Page2.Xaml
4) Double click on MainPage.Xaml
5) Insert the following code:
6) Now MainPage.Xaml should look like this:
7) Now open MainPage.Xaml.Cs file and write the following code under Button definition:
8) Now open Page2.Xaml and add the following code:
9) Open its C# file i.e. Page2.Xaml.CS and add the following code:
10) Navigation between multiple pages is achieved through these simple steps and the following screenshots shows the navigation between pages done in this tutorial:
MainPage.Xaml
Page2.Xaml
No comments:
Post a Comment