WinJS.Resources.oncontextchanged event

Applies to Windows and Windows Phone

Occurs when the user changes the system's language or contrast, or the scale of the display, or when the user changes any of the items in the current context's qualifier values list. For more info about the current context's qualifier values list, see the Remarks section.

Syntax


function handler(eventInfo) { /* Your code here */ }
WinJS.Resources.addEventListener("contextchanged", handler);
WinJS.Resources.removeEventListener("contextchanged", handler);

- or -

function handler(eventInfo) { /* Your code here */ }
WinJS.Resources.oncontextchanged = handler;


Event information

SynchronousNo
BubblesYes
CancelableYes

Event handler parameters

eventInfo

Type: CustomEvent

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

detail.qualifier

The name of the context qualifier that changed.

Here are the possible string qualifier names that can change.

"Language"

The language, such as, "en-us" for United States English.

"Contrast"

The contrast of the display.

"Scale"

The scale of the display as a percentage.

"HomeRegion"

The region, such as, North America.

"TargetSize"

The size of the target, such as, "256".

"LayoutDirection"

The layout direction, such as, left to right.

"Configuration"

The configuration.

"AlternateForm"

The alternate form.

"DXFeatureLevel"

The DirectX feature level.

detail.changed

The new value of the context qualifier that changed. For possible values, see Windows.ApplicationModel.Resources.Core.ResourceContext.qualifierValues.

Remarks

To obtain the current list of applicable qualifier values, call Windows.ApplicationModel.Resources.Core.ResourceContext.getForCurrentView.

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.Resources

Library

Base.js

See also

WinJS.Resources

 

 

Show:
© 2014 Microsoft