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.

No Responses

  1. GoForward in Your Windows Phone Application | ProgramInDotnet August 1, 2011 Reply

Leave a Reply


x

Interesting BlogPosts to read

Download - Pokemon Go for for Windows 10 (Third Party app)
Pokemon Go is one of the popular AR games for android and iOS devices and now , the game is made ava...
Open Wordpad from command line in Windows
You can use the command "Write" from command line in Windows to open the WordPad application.D:\>...
Popular cross-platform (android and iOS) to-do list app
In this blog post, we will cover some of the popular to-do list app that is available on different p...