Reputation: 1
In the Below Code, I want to pass Value of TextBlock1 which is in Navigation Page to the TextBlock2 which is in the Destination Page...!
Code in Navigation Page :
NavigationService.Navigate(new Uri("/Views/DestinationPage.xaml?parameter=textBlock1.Text", UriKind.Relative));
Code in Destination Page :
string parameter = string.Empty;
if (NavigationContext.QueryString.TryGetValue("parameter", out parameter))
{
this.textBlock_Result.Text = parameter;
}
Upvotes: 0
Views: 55
Reputation: 222532
Navigation page:
NavigationService.Navigate(new Uri("/Views/DestinationPage.xaml?parameter=" + textBlock1.Text, UriKind.Relative));
Destination Page :
if(NavigationContext.QueryString.TryGetValue(“parameter”,out parameter))
{
this.textBlock_Result.Text = parameter;
}
Upvotes: 1