Language
Edit

IDialog Interface

Definition

An IDialog hydrates and controls the various sub-components of the dialog view.

public interface IDialog
type IDialog = interface
Public Interface IDialog
Derived

Remarks

IDialogs are typically spawned, pooled, and killed by DialogPools. Generally, developers should not directly manage or instantiate instances of their dialogs, as it is essential that they are pooled and managed correctly by a coordinator.

Properties

Name Description
OnDismissed

This event is fired when the dialog is dismissed, either through user inaction, or by some other foreground action taking precedence.

VisibleRoot

The dialog's root Unity game object, used for setting visibility.

Methods

Name Description
Dismiss()

Dismisses the dialog. Unsubscribes all listeners from the dialog's events, plays the dismiss animation, and then invokes OnDismissed immediately.

Reset()

Clears all content, events, and configuration from the dialog. Useful when pooling Dialog objects, to ensure that subsequent uses of the object don't retain stale data.

SetBody(String)

Sets the body text on the dialog.

SetHeader(String)

Sets the header text on the dialog. This is generally displayed in a more prominent position and/or with more prominent styling than the body text.

SetNegative(String, Action<DialogButtonEventArgs>)

Adds a negative option on the Dialog. action will be invoked when the option is selected. label will be affixed to the associated button.

SetNeutral(String, Action<DialogButtonEventArgs>)

Adds a neutral option on the Dialog. action will be invoked when the option is selected. label will be affixed to the associated button.

SetPositive(String, Action<DialogButtonEventArgs>)

Adds a positive option on the Dialog. action will be invoked when the option is selected. label will be affixed to the associated button.

Show()

Shows this IDialog object. Call this method after the content and actions have been specified with the fluent methods.

ShowAsync()

An asynchronous operation that returns a DialogDismissedEventArgs that represents the result of the user's choice. The task will complete once the dialog dismissed, either by user action or by some other foreground action. If the user does not select an option, the Choice property will be null.

Applies to