Parameters and Navigation in Windows Phone 7

13 Oct

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.


by xamlgeek

4 Responses to “Parameters and Navigation in Windows Phone 7”

  1. Roboblob October 16, 2010 at 22:57 #


    take a look at my solution for Silverlight Navigation with Prism:

  2. Gustaf Lindqvist October 17, 2010 at 14:57 #

    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.

  3. Adrian Aisemberg July 5, 2011 at 11:38 #

    Kick-ass WP7 navigation without passing any strings. Any object type is supported:

    // source
    private void NavigateToSomePage()

    // target
    protected override void OnNavigatedTo(NavigationEventArgs e)

    var data = NavigationContext.GetData();

    // continue

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: