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.
NavigationService.Navigate(new Uri("/Pasge2.xaml?parameter=value", Urikind.Relative));
Pick it up on the target page using
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (NavigationContext.QueryString.ContainsKey("key"))
{
string val = NavigationContext.QueryString["key"];
}
}
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.
NavigationService.Navigate(new Uri("/Pasge2.xaml?parameter=value", Urikind.Relative));
Pick it up on the target page using
NavigationContext.QueryString
:protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (NavigationContext.QueryString.ContainsKey("key"))
{
string val = NavigationContext.QueryString["key"];
}
}
Comments
Post a Comment