WinJS.Application.stop function
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.
WinJS.Application.stop();
This method has no parameters.
This function does not return a value.
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 call to WinJS.Application.stop, 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);
Minimum WinJS version |
WinJS 1.0 |
Namespace |
WinJS.Application |