Saving Persistent State

Persistent state is usually stored whenever transient state is stored. In addition, your app should save its persistent state when it is closing, by subscription to the PhoneApplicationService.Closing event. Persistent state may include files or application settings, as shown in the following excerpt from the App class:

void Application_Closing(object sender, ClosingEventArgs e){    System.IO.IsolatedStorage        .IsolatedStorageSettings.ApplicationSettings["someObject Key"]             = someObject;}

Note

Transient state should not be retained when the Closing event occurs.

Note

Windows Phone 8 offers an alternative storage API present in the Windows.Storage namespace. You explore this ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.