Windows Phone currently does not support third-party applications ProgramRunning in the background, Microsoft provides another method called tomstone. Although mango updates support so-called "multi-task", we still need to process the tombstone, is there any way to simplify our tombstone operations, of course.
There is such an open-source project in codeplex, tombstonehelper
The following uses a specific demo to demonstrate how to use this help class library to simplify our tombstoneCode.
Create the wp7tombstone project and place some textbox and radiobutton controls on the main interface.
Download the corresponding class library from codeplex and add it to the project. Then we need to configure it. The configuration is quite simple, you only need to add the following code to the onnavigatedfrom and onnavigatedto events on the page that requires the tombstone
At this point, it's easy to operate and handle the tombstone operation!
If you do not want to add the code to each page, you can also change the page to inherit from autotombstonepage
Next let's take a look at this class library if it is saved as a tombstone .. we also need to download it under codeplex.Source code, The latest version is 2.0 (a lot of controls are added compared with the previous 1.0)
Is the structure of tombstonehelper. It can be seen that almost every control has a corresponding class processing tombstone.
Let's take a look at the most common textbox processing code.
It is actually saved to the state of phoneapplicationpage.
Code download: Use tombstonehelper to simplify tombstone operations