Displays a modal dialog which can display arbitrary HTML content.

Hierarchy

  • ContentDialog

Constructors

  • Creates a new ContentDialog control.

    Parameters

    • Optional element: HTMLElement
    • Optional options: any

      An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events.

    Returns ContentDialog

Properties

element: HTMLElement

Gets the DOM element that hosts the ContentDialog control.

hidden: boolean

Gets or sets the ContentDialog's visibility.

primaryCommandDisabled: boolean

Indicates whether the button representing the primary command is currently disabled.

primaryCommandText: string

The text displayed on the primary command's button.

secondaryCommandDisabled: boolean

Indicates whether the button representing the secondary command is currently disabled.

secondaryCommandText: string

The text displayed on the secondary command's button.

title: string

The text displayed as the title of the dialog.

DismissalResult: { none: string; primary: string; secondary: string }

Specifies the result of dismissing the ContentDialog.

Type declaration

  • none: string

    The dialog was dismissed without the user selecting any of the commands. The user may have dismissed the dialog by hitting the escape key or pressing the hardware back button.

  • primary: string

    The user dismissed the dialog by pressing the primary command.

  • secondary: string

    The user dismissed the dialog by pressing the secondary command.

supportedForProcessing: boolean

Indicates that the object is compatibile with declarative processing.

Methods

  • Registers an event handler for the specified event.

    Parameters

    • type: string
    • listener: Function
    • Optional useCapture: boolean

      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.

    Returns void

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

    Returns

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

    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

  • Disposes this control.

    Returns void

  • Hides the ContentDialog.

    Parameters

    • Optional result: any

      A value indicating why the dialog is being hidden. The promise returned by show will be fulfilled with this value.

    Returns void

  • Raised immediately after a dialog is fully shown.

    Parameters

    • eventInfo: Event

      An object that contains information about the event.

    Returns void

  • Raised just before hiding a dialog. Call preventDefault on this event to stop the dialog from being hidden.

    Parameters

    Returns void

  • Raised just before showing a dialog. Call preventDefault on this event to stop the dialog from being shown.

    Parameters

    • eventInfo: Event

      An object that contains information about the event.

    Returns void

  • Removes an event handler that the addEventListener method registered.

    Parameters

    • type: string
    • listener: Function
    • Optional useCapture: boolean

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

    Returns void

  • Shows the ContentDialog. Only one ContentDialog may be shown at a time. If another ContentDialog is already shown, this ContentDialog will remain hidden.

    Returns

    A promise which is successfully fulfilled when the dialog is dismissed. The completion value indicates the dialog's dismissal result. This may be 'primary', 'secondary', 'none', or whatever custom value was passed to hide. If this ContentDialog cannot be shown because a ContentDialog is already showing or the ContentDialog is disposed, then the return value is a promise which is in an error state. If preventDefault() is called on the beforeshow event, then this promise will be canceled.

    Returns Promise<ContentDialogHideInfo>

Generated using TypeDoc