IDialog Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
| SetNeutral(String, Action<DialogButtonEventArgs>) |
Adds a neutral option on the Dialog. |
| SetPositive(String, Action<DialogButtonEventArgs>) |
Adds a positive option on the Dialog. |
| 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. |