Module Application

Index

Variables

Functions

Variables

local: IOHelper

The local storage of the application.

roaming: IOHelper

The roaming storage of the application.

sessionState: any

An object used for storing app information that can be used to restore the app's state after it has been suspended and then resumed. Data that can usefully be contained in this object includes the current navigation page or any information the user has added to the input controls on the page. You should not add information about customization (for example colors) or user-defined lists of content.

temp: IOHelper

The temp storage of the application.

Functions

addEventListener(type: string, listener: Function, capture?: boolean)

Adds an event listener for application-level events: activated, checkpoint, error, loaded, ready, settings, and unload.

Parameters

  • type: string

    The type (name) of the event. You can use any of the following:"activated", "checkpoint", "error", "loaded", "ready", "settings", and" unload".

  • listener: Function

    The listener to invoke when the event is raised.

  • capture?: boolean optional

    true to initiate capture, otherwise false.

checkpoint()

Queues a checkpoint event.

onactivated(eventInfo: CustomEvent)

Occurs when WinRT activation has occurred. The name of this event is "activated" (and also "mainwindowactivated"). This event occurs after the loaded event and before the ready event.

Parameters

  • eventInfo: CustomEvent

    An object that contains information about the event. For more information about event arguments, see the WinRT event argument classes: WebUICachedFileUpdaterActivatedEventArgs, WebUICameraSettingsActivatedEventArgs, WebUIContactPickerActivatedEventArgs, WebUIDeviceActivatedEventArgs, WebUIFileActivatedEventArgs, WebUIFileOpenPickerActivatedEventArgs, WebUIFileSavePickerActivatedEventArgs, WebUILaunchActivatedEventArgs, WebUIPrintTaskSettingsActivatedEventArgs, WebUIProtocolActivatedEventArgs, WebUISearchActivatedEventArgs, WebUIShareTargetActivatedEventArgs.

oncheckpoint(eventInfo: CustomEvent)

Occurs when receiving PLM notification or when the checkpoint function is called.

Parameters

  • eventInfo: CustomEvent

    An object that contains information about the event. The detail property of this object includes the following subproperties: type, setPromise.

onerror(eventInfo: CustomEvent)

Occurs when an unhandled error has been raised.

Parameters

  • eventInfo: CustomEvent

    An object that contains information about the event.

onloaded(eventInfo: CustomEvent)

Occurs after the DOMContentLoaded event, which fires after the page has been parsed but before all the resources are loaded. This event occurs before the activated event and the ready event.

Parameters

  • eventInfo: CustomEvent

    An object that contains information about the event. The detail property of this object includes the following subproperties: type, setPromise.

onready(eventInfo: CustomEvent)

Occurs when the application is ready. This event occurs after the loaded event and the activated event.

Parameters

  • eventInfo: CustomEvent

    An object that contains information about the event. The detail property of this object includes the following sub-properties: type, setPromise.

onsettings(eventInfo: CustomEvent)

Occurs when the settings charm is invoked.

Parameters

  • eventInfo: CustomEvent

    An object that contains information about the event. The detail property of this object contains the following sub-properties: type, applicationcommands.

onunload(eventInfo: CustomEvent)

Occurs when the application is about to be unloaded.

Parameters

  • eventInfo: CustomEvent

    An object that contains information about the event. The detail property of this object includes the following sub-properties: type, setPromise.

queueEvent(eventRecord: any)

Queues an event to be processed by the WinJS.Application event queue.

Parameters

  • eventRecord: any

    The event object is expected to have a type property that is used as the event name when dispatching on the WinJS.Application event queue. The entire object is provided to event listeners in the detail property of the event.

removeEventListener(type: string, listener: Function, useCapture?: any)

Removes an event listener from the control.

Parameters

  • type: string

    The type (name) of the event.

  • listener: Function

    The listener to remove.

  • useCapture?: any optional

    Specifies whether or not to initiate capture.

setPromise(promise: Promise)

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 set inside the handlers for all WinJS.Application events: onactivated oncheckpoint onerror onloaded onready onsettings onunload.

Parameters

  • promise: Promise

    The promise that should complete before processing is complete.

start()

Starts dispatching application events (the activated, checkpoint, error, loaded, ready, settings, and unload events).

stop()

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.