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