Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are several ways to accomplish this but none of them is truely elegant. The main issue being to handle tombstoning scenarios : To be restored entirely, your page has to be able to retrieve its input list even if the App has just been re-activated (and all previous states coming from previous navigation erased...)</p> <ul> <li>You can serialize your list with your own custom format and add it to the end of your Uri. The downside being that you have to parse and deserialize the Uri by yourself (Maybe this way looks more natural for simple and small amount of data like an id for instance).</li> </ul> <p>To navigate to the next page :</p> <pre><code>NavigationService.Navigate(new Uri("/WeatherInfoPage.xaml?data1;data2;serializeddata", UriKind.Relative)); </code></pre> <p>To retrieve data in the next page, you would have to parse and to deserialize it from the current Uri :</p> <pre><code> Uri currentUri = ((App)Application.Current).RootFrame.CurrentSource; </code></pre> <ul> <li><p>You can also store your list into a dedicated variable located in <a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj714090%28v=vs.105%29.aspx" rel="nofollow">AppSettings</a> or <a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff967547%28v=vs.105%29.aspx" rel="nofollow">PhoneApplicationService.Current.State</a> before navigating and retrieving it in the new page. Perharps it could be interesting to create a dedicated class to do this job. It could be a centralized place to push and retrieve parameters, to ensure parameters uniqueness, to manage parameters lifetime and so on... It could also be applied to the first proposal.</p></li> <li><p>Finally, if your list is persisted somewhere (a file, embedded database), you can just pass an id to the next page (using previous proposals) and retrieve the corresponding list by querying it from your persisted source.</p></li> </ul> <p>In both cases, you will be able to pass your list to the next page and handle tombstoning scenarios.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload