Class Popup<T>
A generic base class for popups.
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: solution.dll
Syntax
public abstract class Popup<T> : Popup where T : Popup<T>
Type Parameters
Name | Description |
---|---|
T | A sealed popup class type. |
Constructors
Popup(VisualElement, VisualElement, VisualElement)
Default constructor.
Declaration
protected Popup(VisualElement parentView, VisualElement view, VisualElement contentView = null)
Parameters
Type | Name | Description |
---|---|---|
VisualElement | parentView | The popup container. |
VisualElement | view | The popup visual element itself. |
VisualElement | contentView | The content that will appear inside this popup. |
Fields
m_LastFocusedElement
The last focused element before the popup was shown.
Declaration
protected Focusable m_LastFocusedElement
Field Value
Type | Description |
---|---|
Focusable |
Methods
InvokeDismissedEventHandlers(DismissType)
Called when the popup has been dismissed. This method will invoke any handlers attached to the dismissed event.
Declaration
protected override void InvokeDismissedEventHandlers(DismissType reason)
Parameters
Type | Name | Description |
---|---|---|
DismissType | reason |
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
SetKeyboardDismiss(bool)
Activate the possibility to dismiss the popup via Escape key or Return button.
Declaration
public T SetKeyboardDismiss(bool dismissEnabled)
Parameters
Type | Name | Description |
---|---|---|
bool | dismissEnabled |
|
Returns
Type | Description |
---|---|
T | The popup of type |
SetLastFocusedElement(Focusable)
Set the last focused element before the popup was shown.
Declaration
public T SetLastFocusedElement(Focusable focusable)
Parameters
Type | Name | Description |
---|---|---|
Focusable | focusable | The last focused element. |
Returns
Type | Description |
---|---|
T | The popup of type |
Events
dismissed
Event triggered when the popup has been dismissed.
Declaration
public event Action<T, DismissType> dismissed
Event Type
Type | Description |
---|---|
Action<T, DismissType> |
shown
Event triggered when the popup has become visible.
Declaration
public event Action<T> shown
Event Type
Type | Description |
---|---|
Action<T> |