Class Popup<T>
A generic base class for popups.
Inherited Members
Namespace: UnityEngine.Dt.App.UI
Syntax
public abstract class Popup<T> : Popup where T : Popup<T>
Type Parameters
Name | Description |
---|---|
T | A sealed popup class type. |
Constructors
Popup(VisualElement, ApplicationContext, VisualElement, VisualElement)
Default constructor.
Declaration
protected Popup(VisualElement parentView, ApplicationContext context, VisualElement view, VisualElement contentView = null)
Parameters
Type | Name | Description |
---|---|---|
VisualElement | parentView | The popup container. |
ApplicationContext | context | The application context attached to this popup. |
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(Boolean)
Activate the possibility to dismiss the popup via Escape key or Return button.
Declaration
public T SetKeyboardDismiss(bool dismissEnabled)
Parameters
Type | Name | Description |
---|---|---|
Boolean | 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> |