Class AppBarCommand

Represents a command to be displayed in an app bar.

Index

Constructor methods

Properties

Methods

Constructor methods

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

Creates a new AppBarCommand 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 AppBarCommand.

Returns

AppBarCommand

Properties

public disabled: boolean

Gets or sets a value that indicates whether the AppBarCommand is disabled.

public element: HTMLElement

Gets the DOM element that hosts the AppBarCommand.

public extraClass: string

Adds an extra CSS class during construction.

public firstElementFocus: HTMLElement

Gets or sets the HTMLElement with a 'content' type AppBarCommand that should receive focus whenever focus moves by the user pressing HOME or the arrow keys, from the previous AppBarCommand to this AppBarCommand.

public flyout: Flyout

Gets or sets the Flyout object displayed by this command. The specified flyout is shown when the AppBarCommand's button is invoked.

public hidden: boolean

Gets or sets a value that indicates whether the AppBarCommand is hiding or in the process of becoming hidden.

public icon: string

Gets or sets the icon of the AppBarCommand.

public id: string

Gets the element identifier (ID) of the command.

public label: string

Gets or sets the label of the command.

public lastElementFocus: HTMLElement

Gets or sets the HTMLElement with a 'content' type AppBarCommand that should receive focus whenever focus moves by the user pressing END or the arrow keys, from the previous AppBarCommand to this AppBarCommand.

public onclick: Function

Gets or sets the function to be invoked when the command is clicked.

public section: string

Gets the section of the app bar that the command is in.

public selected: boolean

Gets or sets the selected state of a toggle button.

public tooltip: string

Gets or sets the tooltip of the command.

public type: string

Gets the type of the command.

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.

  • 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 dispose()

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

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.