GoForward in Your Windows Phone Application

The Developers can use the NavigationServices to navigate from one form to another in Windows Phone .

This class also provides functions GoBack that simulates the Hardware backbutton .

Here’s a simple example that demonstrates the GoBack .

 

 
private void btnNavigate_Click(object sender, RoutedEventArgs e)
{
     NavigationService.Navigate(new Uri("/Page1.xaml", UriKind.RelativeOrAbsolute));
}

private void btnForward_Click(object sender, RoutedEventArgs e)
{
     NavigationService.GoForward();
}

private void button1_Click(object sender, RoutedEventArgs e)
{
     NavigationService.GoBack();
}

When you click on the back button , this will simulate the hardware back button .

When you click on the Button forward , you will get an exception “Cannot go forward when CanGoForward is false.”

This is because , currently the WP7 does not support forward navigation and when used , the field CanGoForward is also false and hence we get this exception .

Wondering why is this is included when it is not supported :(

 

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
Pin It

3 thoughts on “GoForward in Your Windows Phone Application

  1. Pingback: Interesting .NET Links - July 12 , 2011 | Tech Blog

  2. Pingback: GoForward in Your Windows Phone Application | ProgramInDotnet

  3. Pingback: GoForward in Your Windows Phone ApplicationMobileOSGeek

Leave a Reply

Your email address will not be published. Required fields are marked *