2
How to pass parameter between pages in Windows Phone 8 . 1?
In the previous version it was made like this:
Pag 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));
}
Pag 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 the NavigationContext
.
How should I proceed?