How to pass parameter between pages in Windows Phone 8 .1?
In the previous version it was done like this:
Page 1:
private void Button_Click(object sender, RoutedEventArgs e)
{
string uri = string.Format("/Pagina2.xaml?nomeParametro={0}", txtValor.Text);
NavigationService.Navigate(new Uri(uri, uriKind.Relative));
}
Page 2:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (NavigationContext.QueryString["nomeParametro"] != null)
txtParametro.Text = NavigationContext.QueryString["nomeParametro"];
base.OnNavigatedTo(e);
}
However, in the current version it is no longer possible to use NavigationContext
.
How do I proceed?