Sending and retrieving parameters through page navigation can be really useful. Windows Phone 7 uses a navigation system that allows this feature using the NavigationContext and QueryString.
Sending a parameter
Sending a parameter is just like sending a QueryString parameter as part of an url and I use the NavigationService to navigate.
Receiving a parameter
Receiving a parameter is just as easy as sending it and just like receiving a normal QueryString parameter. To receive the parameter I’m using the NavigationContext that can retrieve QueryString parameters.
Hi,
take a look at my solution for Silverlight Navigation with Prism:
http://blog.roboblob.com/2010/10/15/combining-silverlight-navigation-framework-and-prism-to-create-mvvm-applications-introduction/
Is it possible to use Prism with Windows Phone 7 SDK?
Feels like it’s dangerous to use QueryString to pass data between the navigation page? Thinking of magic strings and when to maintain an application.
Kick-ass WP7 navigation without passing any strings. Any object type is supported: http://www.sharpregion.com/easy-windows-phone-7-navigation/
// source
private void NavigateToSomePage()
{
NavigationService.Navigate(data);
}
// target
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
var data = NavigationContext.GetData();
// continue
}