Windows 8 Application Activation

Source: Internet
Author: User
Program The activation example demonstrates how to activate your Metro application. For an example demonstrates how to handle activation, suspension, and recovery, see the program activation and suspension example ( Function (){
VaR APP = winjs. Application;

FunctionScenario1refresh (){
Location. Reload (True);
}

function onscenariochanged () {
/// do any necessary clean up on the output, the scenario id
/// can be obtained from sdksample. scenarioid.
sdksample. displaystatus ("");
}

function domcontentloadedhandler () {
document. getelementbyid ("scenarios "). addeventlistener ("change", /* @ static_cast (eventlistener) */ onscenariochanged, false );
}

function activatedhandler () {
/// populate the text boxes with the previusly saved values
If (App. sessionstate. person) {
document. getelementbyid ("firstname "). value = app. sessionstate. person. firstname;
document. getelementbyid ("lastname "). value = app. sessionstate. person. lastname;
}< BR >}

function checkpointhandler () {
/// these will get written out on the next checkpoint event
var person = New Object ();
person. firstname = document. getelementbyid ("firstname "). value;
person. lastname = document. getelementbyid ("lastname "). value;
app. sessionstate. person = person;
}

Document. addeventlistener ("domcontentloaded", domcontentloadedhandler,False);
App. addeventlistener ("activated", activatedhandler );
App. addeventlistener ("checkpoint", checkpointhandler );

})();

CompleteCode

/Files/risk/windows8/APP activation sample.rar

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.