WinJS.Resources.oncontextchanged event

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

Synchronous No
Bubbles Yes
Cancelable Yes

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 country/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 WinJS version

WinJS 1.0

Namespace

WinJS.Resources

See also

WinJS.Resources