December 2013
Intermediate to advanced
480 pages
14h 11m
English
WinJS.Application events are different than normal DOM events because they support promises. You can execute an asynchronous task during a WinJS.Application event and delay the next event until a promise completes.
For example, the default.js file created when you create a new Windows Store app project delays the completion of the WinJS.Application.activated event until the asynchronous call to WinJS.UI.processAll() completes. This ensures that all of the controls in the page are processed before the splash screen is torn down.
Here’s what the WinJS.Application.activated event handler looks like in the default.js file with some code removed:
app.onactivated = function (args) {
Read now
Unlock full access