Class AlertDialog
AlertDialog UI element.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: solution.dll
Syntax
public class AlertDialog : BaseDialog, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, ISizeableElement, IDismissInvocator
Constructors
AlertDialog()
Default constructor.
Declaration
public AlertDialog()
Fields
cancelActionUssClassName
The AlertDialog cancel action styling class.
Declaration
public static readonly string cancelActionUssClassName
Field Value
Type | Description |
---|---|
string |
iconUssClassName
The AlertDialog icon styling class.
Declaration
public static readonly string iconUssClassName
Field Value
Type | Description |
---|---|
string |
primaryActionUssClassName
The AlertDialog primary action styling class.
Declaration
public static readonly string primaryActionUssClassName
Field Value
Type | Description |
---|---|
string |
secondaryActionUssClassName
The AlertDialog secondary action styling class.
Declaration
public static readonly string secondaryActionUssClassName
Field Value
Type | Description |
---|---|
string |
Properties
cancelButton
The AlertDialog cancel action button.
Declaration
public Button cancelButton { get; }
Property Value
Type | Description |
---|---|
Button |
isPrimaryActionDisabled
Is the primary action button disabled.
Declaration
public bool isPrimaryActionDisabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
isSecondaryActionDisabled
Is the secondary action button disabled.
Declaration
public bool isSecondaryActionDisabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
primaryButton
The AlertDialog primary action button.
Declaration
public Button primaryButton { get; }
Property Value
Type | Description |
---|---|
Button |
secondaryButton
The AlertDialog secondary action button.
Declaration
public Button secondaryButton { get; }
Property Value
Type | Description |
---|---|
Button |
variant
The current variant used by the AlertDialog.
Declaration
[Tooltip("The current semantic variant used by the AlertDialog.")]
public AlertSemantic variant { get; set; }
Property Value
Type | Description |
---|---|
AlertSemantic |
Methods
SetCancelAction(int, string)
Bind an Action as a the cancel action of the Alert.
Declaration
public void SetCancelAction(int actionId, string displayText)
Parameters
Type | Name | Description |
---|---|---|
int | actionId | The Action Identifier. |
string | displayText | The text to display inside the action's button. |
SetPrimaryAction(int, string, Action)
Bind an Action as a the primary action of the Alert.
Declaration
public void SetPrimaryAction(int actionId, string displayText, Action callback)
Parameters
Type | Name | Description |
---|---|---|
int | actionId | The Action Identifier. |
string | displayText | The text to display inside the action's button. |
Action | callback | The callback invoked if the action is triggered. |
SetSecondaryAction(int, string, Action)
Bind an Action as a the secondary action of the Alert.
Declaration
public void SetSecondaryAction(int actionId, string displayText, Action callback)
Parameters
Type | Name | Description |
---|---|---|
int | actionId | The Action Identifier. |
string | displayText | The text to display inside the action's button. |
Action | callback | The callback invoked if the action is triggered. |
Events
dismissRequested
An event invoked when the user requests to dismiss the AlertDialog.
Declaration
public event Action<DismissType> dismissRequested
Event Type
Type | Description |
---|---|
Action<DismissType> |