Class DialogTrigger
DialogTrigger serves as a wrapper around a Dialog and its associated trigger, linking the Dialog's open state with the trigger's press state. Additionally, it allows you to customize the type and positioning of the Dialog.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class DialogTrigger : BaseVisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
Constructors
DialogTrigger()
Default constructor.
Declaration
public DialogTrigger()
Properties
anchor
The UI element used as an anchor.
Declaration
[CreateProperty]
public VisualElement anchor { get; set; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
Remarks
This is only useful for presentations using popups of type AnchorPopup<T>.
containerPadding
The padding in pixels of the content inside the Popup.
Declaration
[CreateProperty]
[UxmlAttribute]
public int containerPadding { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
contentContainer
The content container of the DialogTrigger.
Declaration
public override VisualElement contentContainer { get; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
Overrides
crossOffset
The offset in pixels in the direction of the placement secondary vector.
Declaration
[CreateProperty]
[UxmlAttribute]
public int crossOffset { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
dialog
The dialog to display.
Declaration
[CreateProperty(ReadOnly = true)]
public BaseDialog dialog { get; }
Property Value
| Type | Description |
|---|---|
| BaseDialog |
disableAnimation
Whether to disable the opening and closing animation of the dialog.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool disableAnimation { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
hideArrow
Should the arrow be hidden.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool hideArrow { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
This property is only useful with Popover presentation type.
isOpen
The open state of the dialog.
Declaration
[CreateProperty(ReadOnly = true)]
public bool isOpen { get; }
Property Value
| Type | Description |
|---|---|
| bool |
keyboardDismissEnabled
Disallow the use of Escape key or Return button to dismiss the dialog.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool keyboardDismissEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
mobileType
The type of presentation used for this dialog element on mobile platforms.
Declaration
[CreateProperty]
[UxmlAttribute]
public MobilePopupPresentationType mobileType { get; set; }
Property Value
| Type | Description |
|---|---|
| MobilePopupPresentationType |
modalBackdrop
Enable or disable the blocking of the UI behind the dialog.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool modalBackdrop { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
This property works only with Popover presentation type.
movable
Whether the dialog is movable by dragging.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool movable { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
This is only useful for presentations using popups of type Popover.
offset
The offset in pixels in the direction of the placement primary vector.
Declaration
[CreateProperty]
[UxmlAttribute]
public int offset { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
outsideClickDismissEnabled
Allow the use of clicking outside the dialog to dismiss it.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool outsideClickDismissEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
This property works only with Popover presentation type.
placement
The placement of the Popover.
Declaration
[CreateProperty]
[UxmlAttribute]
public PopoverPlacement placement { get; set; }
Property Value
| Type | Description |
|---|---|
| PopoverPlacement |
Remarks
This is only useful for presentations using popups of type AnchorPopup<T>.
resizable
Whether the dialog is resizable.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool resizable { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
This is only useful for presentations using popups of type Popover.
resizeDirection
Which direction the dialog can be resized.
Declaration
[CreateProperty]
[UxmlAttribute]
public Draggable.DragDirection resizeDirection { get; set; }
Property Value
| Type | Description |
|---|---|
| Draggable.DragDirection |
Remarks
This is only useful for presentations using popups of type Popover.
shouldFlip
Should the Popover placement be flipped if there's not enough space.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool shouldFlip { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
transitionDuration
The duration of the transition in milliseconds.
Declaration
[CreateProperty]
[UxmlAttribute]
public int transitionDuration { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
trayPosition
The position of the Tray element.
Declaration
[CreateProperty]
[UxmlAttribute]
public TrayPosition trayPosition { get; set; }
Property Value
| Type | Description |
|---|---|
| TrayPosition |
Remarks
trigger
The trigger that will be used to start the display of the dialog element.
Declaration
[CreateProperty(ReadOnly = true)]
public VisualElement trigger { get; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
type
The type of presentation used for this dialog element.
Declaration
[CreateProperty]
[UxmlAttribute]
public PopupPresentationType type { get; set; }
Property Value
| Type | Description |
|---|---|
| PopupPresentationType |
Remarks
Some types are not available on mobile, to specify different presentation on mobile context use the mobileType property.