Reputation: 31
A have a two pages:
FirstPage — some data; SecondPage — three TextBlocks (they need to pass some data);
but transmitted in only one, how to transfer to other?
FirstPage one parametr transfer:
NavigationService.Navigate(new Uri("/Total.xaml?Pay=" + Uri.EscapeDataString(logic3.ToString()), UriKind.Relative));
SecondPage:
if (NavigationContext.QueryString.ContainsKey("Pay"))
{
paymentTextBlock.Text = NavigationContext.QueryString["Pay"].ToString();
}
How to pass other data?
Thanks!
Upvotes: 1
Views: 271
Reputation: 23157
Just add the others to the end of your Uri using ampersands &
.
NavigationService
.Navigate(new Uri("/Total.xaml?Pay=" + Uri.EscapeDataString(logic3.ToString()) +
"&Parm2=" + Uri.EscapeDataString(someOtherField.ToString(),
UriKind.Relative));
Upvotes: 2