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 new API in Chapter 28.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.198.55