What is the difference between NavigationService.Navigate() method and PhoneApplicationFrame.Source
- by afriza
Taken from Exercise 1: Creating Windows Phone Applications with Microsoft Visual Studio 2010 Express for Windows Phone
Task 3: Step 9
// navigate
this.NavigationService.Navigate(new Uri("/PuzzlePage.xaml", UriKind.Relative));
Note:
The PhoneApplicationPage class provides methods and properties to navigate to pages through its NavigationService property. You can call the Navigate method of the NavigationService and pass the URI for the page as a parameter. You can also use the GoBack and GoForward methods to navigate backward or forward in the navigation history. The hardware back button also provides backward navigation within an application. The event handler shown above uses the NavigationService to go to the PuzzlePage.xaml page.
Task 4: Step 3
(RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame).Source =
new Uri("/ErrorPage.xaml", UriKind.Relative);
Note:
...
Whenever you set the Source property to a value that is different from the displayed content, the frame navigates to the new content.
...
What are the differences and similarities of both techniques?