0

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??

Aju
  • 796
  • 3
  • 10
  • 29

1 Answers1

0

These are the possible ways to pass data while navigating between pages in windows phone

  1. Store data on Windows Phone 7 by using Isolated Storage
  2. Pass data through parameter between pages
  3. Dynamic generate data grid, which contains data and related link button
  4. Use XElement, XAttribute as data structure

For Reference see here

Arul Dinesh
  • 550
  • 4
  • 15