What is the difference between NavigationService.Navigate() method and PhoneApplicationFrame.Source

Posted by afriza on Stack Overflow See other posts from Stack Overflow or by afriza
Published on 2010-05-05T08:34:12Z Indexed on 2010/05/05 8:38 UTC
Read the original article Hit count: 822

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?

© Stack Overflow or respective owner

Related posts about windows-phone-7

Related posts about Silverlight