Practical development tips for Windows Phone (2): Use tombstonehelper to simplify tombstone operations

Source: Internet
Author: User
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

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.