docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Popup<T>

    A generic base class for popups.

    Inheritance
    object
    Popup
    Popup<T>
    AnchorPopup<T>
    BottomNotification<T>
    Modal
    Tray
    Inherited Members
    Popup.k_NextFrameDurationMs
    Popup.k_PopupShow
    Popup.k_PopupDismiss
    Popup.handler
    Popup.keyboardDismissEnabled
    Popup.view
    Popup.targetParent
    Popup.contentView
    Popup.Dismiss()
    Popup.Dismiss(DismissType)
    Popup.ShouldDismiss(DismissType)
    Popup.Show()
    Popup.ShowView()
    Popup.GetFocusableElement()
    Popup.ShouldAnimate()
    Popup.OnViewKeyDown(KeyDownEvent)
    Popup.AnimateViewIn()
    Popup.HideView(DismissType)
    Popup.AnimateViewOut(DismissType)
    Popup.FindSuitableParent(VisualElement)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AppUI.UI
    Assembly: Unity.AppUI.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
    Popup.InvokeDismissedEventHandlers(DismissType)

    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
    Popup.InvokeShownEventHandlers()

    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

    True to activate the feature, False otherwise.

    Returns
    Type Description
    T

    The popup of type T.

    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 T.

    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>
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)