Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8552785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:30:11+00:00 2026-06-11T14:30:11+00:00

Similar questions have been asked before but this question strives to explore more options

  • 0

Similar questions have been asked before but this question strives to explore more options and the ability to pass complex objects.

The question is how to pass parameters but it really needs to be broken up into three parts..

  1. When navigating between pages in an XAML application how do you pass parameters?
  2. What is the difference between using the Uri navigation and manual navigation?
  3. How can objects (not just strings) be passed when using Uri navigation?

Example of Uri navigation

page.NavigationService.Navigate(new Uri("/Views/Page.xaml", UriKind.Relative));

Example of manual navigation

page.NavigationService.Navigate(new Page());

The answer to this question applies to WP7, silverlight, WPF and Windows 8.

Note: There is a difference between Silverlight and Windows8

  • Windows Phone: pages are navigated to using a Uri and data passed as a query string or an instance
  • Windows 8: pages are navigated to by passing the type, and parameters as objects
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:30:13+00:00Added an answer on June 11, 2026 at 2:30 pm

    Methods to pass parameters

    1. Using the query string

    You can pass parameters through the query string, using this method means have to convert your data to strings and url encode them. You should only use this to pass simple data.

    Navigating page:

    page.NavigationService.Navigate(new Uri("/Views/Page.xaml?parameter=test", UriKind.Relative));
    

    Destination page:

    string parameter = string.Empty;
    if (NavigationContext.QueryString.TryGetValue("parameter", out parameter)) {
        this.label.Text = parameter;
    }
    

    2. Using NavigationEventArgs

    Navigating page:

    page.NavigationService.Navigate(new Uri("/Views/Page.xaml?parameter=test", UriKind.Relative));
    
    // and ..
    
    protected override void OnNavigatedFrom(NavigationEventArgs e)
    {
        // NavigationEventArgs returns destination page
        Page destinationPage = e.Content as Page;
        if (destinationPage != null) {
    
            // Change property of destination page
            destinationPage.PublicProperty = "String or object..";
        }
    }
    

    Destination page:

    // Just use the value of "PublicProperty"..
    

    3. Using Manual navigation

    Navigating page:

    page.NavigationService.Navigate(new Page("passing a string to the constructor"));
    

    Destination page:

    public Page(string value) {
        // Use the value in the constructor...
    }
    

    Difference between Uri and manual navigation

    I think the main difference here is the application life cycle. Pages created manually are kept in memory for navigation reasons. Read more about it here.

    Passing complex objects

    You can use method one or two to pass complex objects (recommended). You can also add custom properties to the Application class or store data in Application.Current.Properties.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Similar questions to this my have been asked a lot of times before. But
I've looked for similar questions, but this must have been asked before. Either way,
I know that similar questions to this have been asked before but after doing
I know similar questions have been asked before, but this one is a little
Note: I know similar questions to this have been asked on SO before, but
I know similar questions have been asked before but i think this is slightly
This is a similar question to those that have been asked before, but still
similar questions have been asked before but I cant find an exact match to
I know similar questions have been asked before, but I've tried many times and
I know that similar questions have been asked before, but I am very much

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.