docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class StackView

    A StackView is a container that can contain multiple items. It is similar to a stack of cards. The items are added to the stack using the Push method. The top item is the current item. The current item can be removed using the Pop method. The item below the current item becomes the new current item. The current item can be replaced using the Replace method. The item below the current item is removed and the new item is added.

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    BaseVisualElement
    StackView
    Implements
    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IContextOverrideElement
    Inherited Members
    BaseVisualElement.scaleOverride
    BaseVisualElement.themeOverride
    BaseVisualElement.langOverride
    BaseVisualElement.layoutDirectionOverride
    BaseVisualElement.preferredTooltipPlacementOverride
    BaseVisualElement.tooltipDelayMsOverride
    VisualElement.disabledUssClassName
    VisualElement.ExecuteDefaultAction(EventBase)
    VisualElement.Focus()
    VisualElement.SendEvent(EventBase)
    VisualElement.SetEnabledFromHierarchy(bool)
    VisualElement.SetEnabled(bool)
    VisualElement.MarkDirtyRepaint()
    VisualElement.ContainsPoint(Vector2)
    VisualElement.Overlaps(Rect)
    VisualElement.DoMeasure(float, VisualElement.MeasureMode, float, VisualElement.MeasureMode)
    VisualElement.ToString()
    VisualElement.GetClasses()
    VisualElement.ClearClassList()
    VisualElement.AddToClassList(string)
    VisualElement.RemoveFromClassList(string)
    VisualElement.ToggleInClassList(string)
    VisualElement.EnableInClassList(string, bool)
    VisualElement.ClassListContains(string)
    VisualElement.FindAncestorUserData()
    VisualElement.Add(VisualElement)
    VisualElement.Insert(int, VisualElement)
    VisualElement.Remove(VisualElement)
    VisualElement.RemoveAt(int)
    VisualElement.Clear()
    VisualElement.ElementAt(int)
    VisualElement.IndexOf(VisualElement)
    VisualElement.Children()
    VisualElement.Sort(Comparison<VisualElement>)
    VisualElement.BringToFront()
    VisualElement.SendToBack()
    VisualElement.PlaceBehind(VisualElement)
    VisualElement.PlaceInFront(VisualElement)
    VisualElement.RemoveFromHierarchy()
    VisualElement.GetFirstOfType<T>()
    VisualElement.GetFirstAncestorOfType<T>()
    VisualElement.Contains(VisualElement)
    VisualElement.FindCommonAncestor(VisualElement)
    VisualElement.viewDataKey
    VisualElement.userData
    VisualElement.canGrabFocus
    VisualElement.focusController
    VisualElement.usageHints
    VisualElement.transform
    VisualElement.layout
    VisualElement.contentRect
    VisualElement.paddingRect
    VisualElement.worldBound
    VisualElement.localBound
    VisualElement.worldTransform
    VisualElement.pickingMode
    VisualElement.name
    VisualElement.enabledInHierarchy
    VisualElement.enabledSelf
    VisualElement.visible
    VisualElement.generateVisualContent
    VisualElement.experimental
    VisualElement.hierarchy
    VisualElement.cacheAsBitmap
    VisualElement.parent
    VisualElement.panel
    VisualElement.contentContainer
    VisualElement.visualTreeAssetSource
    VisualElement.this[int]
    VisualElement.childCount
    VisualElement.schedule
    VisualElement.style
    VisualElement.customStyle
    VisualElement.styleSheets
    VisualElement.tooltip
    VisualElement.resolvedStyle
    Focusable.Blur()
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
    CallbackEventHandler.HandleEvent(EventBase)
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    CallbackEventHandler.ExecuteDefaultActionAtTarget(EventBase)
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.AppUI.UI
    Assembly: solution.dll
    Syntax
    public class StackView : BaseVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement

    Constructors

    StackView()

    The constructor of the StackView.

    Declaration
    public StackView()

    Fields

    ussClassName

    The main styling class of the StackView. This is the class that is used in the USS file.

    Declaration
    public static readonly string ussClassName
    Field Value
    Type Description
    string

    Properties

    currentItem

    The current item in the stack.

    Declaration
    public StackViewItem currentItem { get; }
    Property Value
    Type Description
    StackViewItem

    depth

    The depth of the stack.

    Declaration
    public int depth { get; }
    Property Value
    Type Description
    int

    initialItem

    The initial item to add to the stack.

    Declaration
    public VisualElement initialItem { get; set; }
    Property Value
    Type Description
    VisualElement

    isBusy

    Check if the StackView has any active animation.

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

    isEmpty

    Check if the stack is empty.

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

    popEnterAnimation

    The animation to use on the newly active item when an item is popped from the stack.

    Declaration
    public AnimationDescription popEnterAnimation { get; set; }
    Property Value
    Type Description
    AnimationDescription

    popExitAnimation

    The animation to use on the current item when it is popped from the stack.

    Declaration
    public AnimationDescription popExitAnimation { get; set; }
    Property Value
    Type Description
    AnimationDescription

    pushEnterAnimation

    The animation to use on the newly active item when it is pushed to the stack.

    Declaration
    public AnimationDescription pushEnterAnimation { get; set; }
    Property Value
    Type Description
    AnimationDescription

    pushExitAnimation

    The animation to use on the current item when a new item is pushed to the stack.

    Declaration
    public AnimationDescription pushExitAnimation { get; set; }
    Property Value
    Type Description
    AnimationDescription

    replaceEnterAnimation

    The animation to use on the newly active item when it is replaced in the stack.

    Declaration
    public AnimationDescription replaceEnterAnimation { get; set; }
    Property Value
    Type Description
    AnimationDescription

    replaceExitAnimation

    The animation to use on the current item when it is replaced in the stack.

    Declaration
    public AnimationDescription replaceExitAnimation { get; set; }
    Property Value
    Type Description
    AnimationDescription

    Methods

    ClearStack()

    Removes all items from the stack.

    Declaration
    public void ClearStack()

    Pop(StackViewItem, StackViewOperation)

    Pops one or more items off the stack.

    Declaration
    public StackViewItem Pop(StackViewItem item, StackViewOperation operation = StackViewOperation.PopTransition)
    Parameters
    Type Name Description
    StackViewItem item

    If the item argument is specified, all items down to (but not including) item will be popped. If item is null, all items down to (but not including) the first item is popped.

    StackViewOperation operation

    The type of transition to use during the process.

    Returns
    Type Description
    StackViewItem

    Returns the last item removed from the stack.

    Pop(StackViewOperation)

    Pops one or more items off the stack. Only the current item is popped.

    Declaration
    public StackViewItem Pop(StackViewOperation operation = StackViewOperation.PopTransition)
    Parameters
    Type Name Description
    StackViewOperation operation

    The type of transition to use during the process.

    Returns
    Type Description
    StackViewItem

    Returns the last item removed from the stack.

    Push(VisualElement, Action, StackViewOperation)

    Pushes an item onto the stack using an optional operation.

    Declaration
    public StackViewItem Push(VisualElement item, Action callback = null, StackViewOperation operation = StackViewOperation.PushTransition)
    Parameters
    Type Name Description
    VisualElement item

    The item to push onto the stack.

    Action callback

    The callback to call when the operation is completed.

    StackViewOperation operation

    The type of transition to use during the process.

    Returns
    Type Description
    StackViewItem

    Returns the item that became current.

    Replace(StackViewItem, VisualElement, Action, StackViewOperation)

    Replaces one or more items on the stack with the specified item and optional operation.

    Declaration
    public StackViewItem Replace(StackViewItem target, VisualElement item, Action callback = null, StackViewOperation operation = StackViewOperation.ReplaceTransition)
    Parameters
    Type Name Description
    StackViewItem target

    If the target argument is specified, all items down to the target item will be replaced. If target is null, all items in the stack will be replaced.

    VisualElement item

    The item that will be used as replacement.

    Action callback

    The callback to call when the operation is completed.

    StackViewOperation operation

    The type of transition to use during the process.

    Returns
    Type Description
    StackViewItem

    Returns the item that became current.

    Events

    currentItemChanged

    Event emitted when the current item in the stack changes.

    Declaration
    public event Action currentItemChanged
    Event Type
    Type Description
    Action
    Remarks

    The event is emitted at the end of the animation (if any).

    currentItemChanging

    Event emitted when the current item in the stack is about to change.

    Declaration
    public event Action currentItemChanging
    Event Type
    Type Description
    Action
    Remarks

    The event is emitted at the beginning of the animation (if any). Afterwards, currentItemChanged is emitted.

    Implements

    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IContextOverrideElement

    Extension Methods

    VisualElementExtensions.FindNavController(VisualElement)
    VisualElementExtensions.GetChildren<T>(VisualElement, bool)
    VisualElementExtensions.GetContextProvider<T>(VisualElement)
    VisualElementExtensions.GetContext<T>(VisualElement)
    VisualElementExtensions.GetPreferredTooltipPlacement(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement)
    VisualElementExtensions.GetTooltipTemplate(VisualElement)
    VisualElementExtensions.IsContextProvider<T>(VisualElement)
    VisualElementExtensions.ProvideContext<T>(VisualElement, T)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.SetPreferredTooltipPlacement(VisualElement, OptionalEnum<PopoverPlacement>)
    VisualElementExtensions.SetTooltipTemplate(VisualElement, VisualElement)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    In This Article
    • Constructors
      • StackView()
    • Fields
      • ussClassName
    • Properties
      • currentItem
      • depth
      • initialItem
      • isBusy
      • isEmpty
      • popEnterAnimation
      • popExitAnimation
      • pushEnterAnimation
      • pushExitAnimation
      • replaceEnterAnimation
      • replaceExitAnimation
    • Methods
      • ClearStack()
      • Pop(StackViewItem, StackViewOperation)
      • Pop(StackViewOperation)
      • Push(VisualElement, Action, StackViewOperation)
      • Replace(StackViewItem, VisualElement, Action, StackViewOperation)
    • Events
      • currentItemChanged
      • currentItemChanging
    • Implements
    • Extension Methods
    Back to top
    Copyright © 2024 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)