WinJS.Application.stop function

1 out of 1 rated this helpful - Rate this topic

Stops application event processing and resets WinJS.Application to its initial state. All WinJS.Application event listeners (for the activated, checkpoint, error, loaded, ready, settings, and unload events) are removed.

Important  This function does not stop the execution of the app. For more information about the app lifecycle, see Part 2: Manage app lifecycle and state.

Syntax


WinJS.Application.stop();

Parameters

This method has no parameters.

Return value

This function does not return a value.

Examples

If you run the following, you will see "got loaded event", but not "got ready event" or "got activated event" in the JavaScript Console window in the Messages tab. If you comment out the WinJS.Application.stop(); line, all of the WinJS.Application events occur.



   WinJS.Application.start();

    WinJS.Utilities.startLog("example");
    
    WinJS.Application.addEventListener("activated", function (ev) {
        WinJS.log && WinJS.log("got activated event", "example", "info");
    }, false);

    WinJS.Application.addEventListener("loaded", function (ev) {
        WinJS.log && WinJS.log("got loaded event", "example", "info");
        WinJS.Application.stop();

    }, false);

    WinJS.Application.addEventListener("ready", function (ev) {
        WinJS.log && WinJS.log("got ready event", "example", "info");
    }, false);



Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Namespace

WinJS.Application

Library

Base.js

 

 

Build date: 12/5/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.