setPromise method

1 out of 2 rated this helpful - Rate this topic

Informs the application object that asynchronous work is being performed, and that this event handler should not be considered complete until the promise completes. This function can be called inside the handlers for all WinJS.Navigation events:

Syntax


ev.detail.setPromise(promise);

Parameters

promise

Type: Promise

The promise that should complete before processing is complete.

Return value

This method does not return a value.

Examples

The following code shows how to use this method inside an event handler.


WinJS.Navigation.onbeforenavigate = function (ev) {
    ev.detail.setPromise(
        WinJS.Application.roaming.writeText("navfile.txt", "starting navigation at: " + new Date())
    );
};


Requirements

Namespace

WinJS.Navigation

Library

Base.js

 

 

Build date: 12/5/2012

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