In my app, first page(page1) shows the list of items, when an item is selected, i will pass the name to another page(page2) and with that name will get the data from the server.And all the data will be displayed. In the details one of them would be category (grocery,cosmetics etc), so if i click on that textbox it will be navigated to another page(page3) where you can select another category,after selecting another category its name would again be passed back to the detail page(Page2). In my second page i'll get the data with the following code,
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
if (e.Uri.OriginalString.Contains("name"))
{
var ItemName = NavigationContext.QueryString["id"];
//this is a parameter from page1
// do something
}
else if (e.Uri.OriginalString.Contains("category"))
{
var CategoryName= NavigationContext.QueryString["category"];
//this is a parameter from page3
// do something
}
}
but when i come back from page3 to page2, all the details i displayed(by getting the name from page1) is found missing. How can i retain that data??