Class SettingsFlyout

Provides users with fast, in-context access to settings that affect the current Windows Store app.

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(element?: HTMLElement, options?: any): SettingsFlyout

Creates a new SettingsFlyout object.

constructor

Parameters

  • element?: HTMLElement optional

    The DOM element that will host the control.

  • options?: any optional

    The set of properties and values to apply to the new SettingsFlyout.

Returns

SettingsFlyout

Properties

public element: HTMLElement

Gets the DOM element the SettingsFlyout is attached to.

public hidden: boolean

Gets whether the SettingsFlyout is hidden.

public settingsCommandId: string

Gets or sets the settings command Id for the SettingsFlyout control.

public width: string

This property may be unavailable or altered in future versions. Use the CSS width property of the element that has the win-settingsflyout class instead.

Methods

public addEventListener(type: string, listener: Function, useCapture?: boolean)

Registers an event handler for the specified event.

Parameters

  • type: string

    The event type to register. It must be beforeshow, beforehide, aftershow, or afterhide.

  • listener: Function

    The event handler function to associate with the event.

  • useCapture?: boolean optional

    Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase.

public dispatchEvent(type: string, eventProperties: any): boolean

Raises an event of the specified type and with additional properties.

Parameters

  • type: string

    The type (name) of the event.

  • eventProperties: any

    The set of additional properties to be attached to the event object when the event is raised.

Returns

boolean

true if preventDefault was called on the event, otherwise false.

public dispose()

Releases resources held by this SettingsFlyout. Call this method when the SettingsFlyout is no longer needed. After calling this method, the SettingsFlyout becomes unusable.

public hide()

Hides the SettingsFlyout, if visible, regardless of other states.

public onafterhide(eventInfo: Event)

Raised immediately after the SettingsFlyout is completely hidden.

Parameters

  • eventInfo: Event

    An object that contains information about the event.

public onaftershow(eventInfo: Event)

Raised immediately after a SettingsFlyout is fully shown.

Parameters

  • eventInfo: Event

    An object that contains information about the event.

public onbeforehide(eventInfo: Event)

Raised just before hiding a SettingsFlyout.

Parameters

  • eventInfo: Event

    An object that contains information about the event.

public onbeforeshow(eventInfo: Event)

Raised just before showing a SettingsFlyout.

Parameters

  • eventInfo: Event

    An object that contains information about the event.

public static populateSettings(e: CustomEvent)

Loads a fragment of the SettingsFlyout. Your app calls this when the user invokes a settings command and the WinJS.Application.onsettings event occurs.

Parameters

  • e: CustomEvent

    An object that contains information about the event, received from the WinJS.Application.onsettings event. The detail property of this object contains the applicationcommands sub-property that you set to an array of settings commands. You then populate the SettingsFlyout with these commands by a call to populateSettings.

public removeEventListener(type: string, listener: Function, useCapture?: boolean)

Removes an event handler that the addEventListener method registered.

Parameters

  • type: string

    The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide.

  • listener: Function

    The event handler function to remove.

  • useCapture?: boolean optional

    Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler.

public static show()

Shows the SettingsPane UI, if hidden, regardless of other state.

public show()

Shows the SettingsPane UI, if hidden.

public static showSettings(id: string, path: any)

Show the Settings flyout using the Settings element identifier (ID) and the path of the page that contains the Settings element.

Parameters

  • id: string

    The ID of the Settings element.

  • path: any

    The path of the page that contains the Settings element.