O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required