Created
May 25, 2013 00:46
-
-
Save chantalgo/5647454 to your computer and use it in GitHub Desktop.
Default JS in WinJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
args.detail.kind : shows the way the app was activated- value comes from the Windows.ApplicationModel.Activation.- ActivationKind enumeration. | |
== launch : when it comes from the Start screen | |
Windows.ApplicationMode.- Activation.ApplicationExecutionState enumeration tells the app how it was last running. | |
*/ | |
// Note (function () { … })(); module pattern | |
(function (){ | |
"use strict"; | |
var app = WinJS.Application; | |
var activation = Windows.ApplicationModel.Activation; | |
app.onactivated = function (args) { | |
if (args.detail.kind === activation.ActivationKind.launch) { | |
if (args.detail.previousExecutionState !== | |
activation.ApplicationExecutionState.terminated) { | |
// TODO: This application has been newly launched. Initialize | |
// your application here. | |
} else { | |
// TODO: This application has been reactivated from suspension. | |
// Restore application state here. | |
} | |
args.setPromise(WinJS.UI.processAll()); | |
/* | |
data-win-control : WinJS.UI.processAll instantiates any WinJS controls that are declared in HTML. | |
data-win-bind : processed by WinJS.Binding.processAll | |
data-win-res : processed by WinJS.Resources.processAll | |
*/ | |
} | |
}; | |
app.oncheckpoint = function (args) { | |
}; | |
app.start(); | |
/* | |
It makes sure that various events that were queued during startup get processed. | |
*/ | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment