EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

WinJS.Application.stop function

Applies to Windows and Windows Phone

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 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);



Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.Application

Library

Base.js

 

 

Anzeigen:
© 2014 Microsoft