docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PopupNotification<T>

    A base class for notification displayed at a specific anchor of the screen.

    Inheritance
    object
    Popup
    Popup<T>
    PopupNotification<T>
    Toast
    Inherited Members
    Popup<T>.m_LastFocusedElement
    Popup<T>.shown
    Popup<T>.dismissed
    Popup<T>.SetContainerView(VisualElement)
    Popup<T>.SetKeyboardDismiss(bool)
    Popup<T>.SetLastFocusedElement(Focusable)
    Popup.m_InvokeShownAction
    Popup.keyboardDismissEnabled
    Popup.view
    Popup.containerView
    Popup.referenceView
    Popup.contentView
    Popup.rootView
    Popup.Dismiss()
    Popup.ShouldDismiss(DismissType)
    Popup.ShowView()
    Popup.GetFocusableElement()
    Popup.OnViewKeyDown(KeyDownEvent)
    Popup.OnLayoutReadyToAnimateIn()
    Popup.PrepareAnimateViewIn()
    Popup.HideView(DismissType)
    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 PopupNotification<T> : Popup<T> where T : PopupNotification<T>
    Type Parameters
    Name Description
    T

    The sealed Notification popup class type.

    Constructors

    PopupNotification(VisualElement, VisualElement)

    Default constructor.

    Declaration
    protected PopupNotification(VisualElement referenceView, VisualElement view)
    Parameters
    Type Name Description
    VisualElement referenceView

    The view used as context provider for the popup notification.

    VisualElement view

    The popup visual element itself.

    Properties

    animationMode

    Returns the animation used by the bar when it will be displayed.

    Declaration
    public AnimationMode animationMode { get; }
    Property Value
    Type Description
    AnimationMode

    duration

    Returns the specified display duration of the bar.

    Declaration
    public NotificationDuration duration { get; }
    Property Value
    Type Description
    NotificationDuration

    isShown

    Returns True if the bar is currently displayed on the screen, False otherwise.

    Declaration
    public bool isShown { get; }
    Property Value
    Type Description
    bool

    isShownOrQueued

    Returns True if the bar is currently displayed or queued for display on the screen, False otherwise.

    Declaration
    public bool isShownOrQueued { get; }
    Property Value
    Type Description
    bool

    position

    Returns the placement of the notification.

    Declaration
    public PopupNotificationPlacement position { get; }
    Property Value
    Type Description
    PopupNotificationPlacement

    Methods

    AnimateViewIn()

    Start the animation for this popup.

    Declaration
    protected override void AnimateViewIn()
    Overrides
    Popup.AnimateViewIn()

    AnimateViewOut(DismissType)

    Start the hide animation for this popup.

    Declaration
    protected override void AnimateViewOut(DismissType reason)
    Parameters
    Type Name Description
    DismissType reason

    The reason why the popup should be dismissed.

    Overrides
    Popup.AnimateViewOut(DismissType)

    Dismiss(DismissType)

    Dismiss the Popup.

    Declaration
    public override void Dismiss(DismissType reason)
    Parameters
    Type Name Description
    DismissType reason

    Why the element has been dismissed.

    Overrides
    Popup.Dismiss(DismissType)

    FindSuitableParent(VisualElement)

    Find the parent VisualElement where the popup will be added.

    Declaration
    protected override VisualElement FindSuitableParent(VisualElement element)
    Parameters
    Type Name Description
    VisualElement element

    An arbitrary UI element inside the panel.

    Returns
    Type Description
    VisualElement

    The popup container VisualElement in the current panel.

    Overrides
    Popup.FindSuitableParent(VisualElement)
    Remarks

    This is usually one of the layers from the Panel root UI element. If no Panel is found, the method will return the visual tree root of the given element.

    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

    The reason for the dismissal.

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

    SetAnimationMode(AnimationMode)

    Set a new value for the animationMode property.

    Declaration
    public T SetAnimationMode(AnimationMode animation)
    Parameters
    Type Name Description
    AnimationMode animation

    THe new value

    Returns
    Type Description
    T

    The current object instance to continuously build the element.

    SetDuration(NotificationDuration)

    Set the duration the notification should be displayed.

    Declaration
    public virtual T SetDuration(NotificationDuration durationValue)
    Parameters
    Type Name Description
    NotificationDuration durationValue

    A duration enum value.

    Returns
    Type Description
    T

    The current object instance to continuously build the element.

    SetPosition(PopupNotificationPlacement)

    Set the position of the notification.

    Declaration
    public virtual T SetPosition(PopupNotificationPlacement positionValue)
    Parameters
    Type Name Description
    PopupNotificationPlacement positionValue

    The position of the notification.

    Returns
    Type Description
    T

    The current object instance to continuously build the element.

    ShouldAnimate()

    Implement this method to know if the popup should call AnimateViewIn() and AnimateViewOut(DismissType) methods or not.

    Declaration
    protected override bool ShouldAnimate()
    Returns
    Type Description
    bool

    True if you want to animate the popup, False otherwise.

    Overrides
    Popup.ShouldAnimate()

    Show()

    Show the Popup.

    Declaration
    public override void Show()
    Overrides
    Popup.Show()
    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)