I have to send the id that I get from a rest web service from page1.xaml to page2.xaml I tried this code:
Page1.xaml.cs:
private async void Grid1_Tapped(object sender, TappedRoutedEventArgs e)
{
UriString2 = "URL";
int x= rootObject.posts[0].id;
string uri = string.Format("/Page2.xaml?x={1}",x);
//adding Navigation Statement
this.Frame.Navigate(typeof(Page2), new Uri(uri, UriKind.Relative));
}
Page2.xaml.cs:
private async void Page_Loaded(object sender, RoutedEventArgs e)
{
int xx = Convert.ToInt32(NavigationContext.QueryString["x"]);
}
this code doesn't work,I have an error "NavigationContext doesn't exist in this context",miss I anything :(
thanks for help