How do you restore the state between pages?
I have an app which gives me a score at the end of the game and I want the users to share their scores on facebook.
I want scoring information to be restored to the "end game" screen after the user has logged into facebook, and move to the facebook section of the panorama/pivot.
How do I go about th开发者_如何学运维is? Do I save that information to storage or to I use a variable in app.xaml.cs?
You should store this data in the page's State
property in the OnNavigatingFrom
or OnNavigatedFrom
events of the page.
You can then access it again in the OnNavigatedTo
event.
The situation you are handling is called tombstoning. Read more about it at http://msdn.microsoft.com/en-us/library/ff817008(v=vs.92).aspx
精彩评论