0

There are 3 xaml pages, 2 of which call the third page with different parameters. How do I write onNavigatedTo() in the third page?

Am using NavigationService.Navigate(new Uri("/third.xaml?paramter=xxxx", UriKind.Relative));

v2b
  • 1,436
  • 9
  • 15
Nitish Bangad
  • 151
  • 1
  • 9
  • possible duplicate of [How to pass values (parameters) between XAML pages?](http://stackoverflow.com/questions/12444816/how-to-pass-values-parameters-between-xaml-pages) – DotNetRussell Aug 01 '13 at 17:56
  • http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff626521(v=vs.105).aspx – Kevin Gosse Aug 01 '13 at 17:59

1 Answers1

0

Borrowed and adapted this code from http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff626521(v=vs.105).aspx.

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
    base.OnNavigatedTo(e);

    string msg = "";

    if (NavigationContext.QueryString.TryGetValue("parameter", out msg))
       // now your parameter is in the msg variable, and you could do stuff here.

    }
Kris Selbekk
  • 7,438
  • 7
  • 46
  • 73