Class Modal
The Modal Popup class.
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public sealed class Modal : Popup<Modal>
Properties
fullscreenMode
Set the fullscreen mode for this Modal.
See Modal
Declaration
public ModalFullScreenMode fullscreenMode { get; set; }
Property Value
Type | Description |
---|---|
Modal |
outsideClickDismissEnabled
True
if the Modal can be dismissed by clicking outside of it, False
otherwise.
Declaration
public bool outsideClickDismissEnabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
outsideClickStrategy
The strategy used to determine if the click is outside the Modal.
Declaration
public OutsideClickStrategy outsideClickStrategy { get; set; }
Property Value
Type | Description |
---|---|
Outside |
Methods
AnimateViewIn()
Start the animation for this popup.
Declaration
protected override void AnimateViewIn()
Overrides
Build(VisualElement, VisualElement)
Build a new Modal component.
Declaration
public static Modal Build(VisualElement referenceView, VisualElement content)
Parameters
Type | Name | Description |
---|---|---|
Visual |
referenceView | An arbitrary UI element inside the UI panel. |
Visual |
content | The Visual |
Returns
Exceptions
Type | Condition |
---|---|
Argument |
If |
GetFocusableElement()
Returns the element that will be focused when the view will become visible.
The default value is `null`.
Declaration
protected override VisualElement GetFocusableElement()
Returns
Type | Description |
---|---|
Visual |
The element that will be focused when the view will become visible. |
Overrides
HideView(DismissType)
Called when it is time to hide the popup.
Declaration
protected override void HideView(DismissType reason)
Parameters
Type | Name | Description |
---|---|---|
Dismiss |
reason | The reason why the popup should be dismissed. |
Overrides
InvokeShownEventHandlers()
Called when the popup has become visible. This method will invoke any handlers attached to the shown event.
Declaration
protected override void InvokeShownEventHandlers()
Overrides
SetFullScreenMode(ModalFullScreenMode)
Set a new value for fullscreen
Declaration
public Modal SetFullScreenMode(ModalFullScreenMode mode)
Parameters
Type | Name | Description |
---|---|---|
Modal |
mode | The new value. |
Returns
SetOutsideClickDismiss(bool)
Activate the possibility to dismiss the Modal by clicking outside of it.
Declaration
public Modal SetOutsideClickDismiss(bool dismissEnabled)
Parameters
Type | Name | Description |
---|---|---|
bool | dismissEnabled |
|
Returns
Type | Description |
---|---|
Modal | The modal |
SetOutsideClickStrategy(OutsideClickStrategy)
Set the strategy used to determine if the click is outside the Modal.
Declaration
public Modal SetOutsideClickStrategy(OutsideClickStrategy strategy)
Parameters
Type | Name | Description |
---|---|---|
Outside |
strategy | The strategy to use. |
Returns
Type | Description |
---|---|
Modal | The modal |
ShouldAnimate()
Implement this method to know if the popup should call
Animate
Declaration
protected override bool ShouldAnimate()
Returns
Type | Description |
---|---|
bool |
|
Overrides
ShouldDismiss(DismissType)
Check if the popup should be dismissed or not, depending on the reason.
Declaration
protected override bool ShouldDismiss(DismissType reason)
Parameters
Type | Name | Description |
---|---|---|
Dismiss |
reason | Why the element has been dismissed. |
Returns
Type | Description |
---|---|
bool |
|