Class Tray
The Tray Popup class.
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public sealed class Tray : Popup<Tray>
Methods
AnimateViewIn()
Start the animation for this popup.
Declaration
protected override void AnimateViewIn()
Overrides
AnimateViewOut(DismissType)
Start the hide animation for this popup.
Declaration
protected override void AnimateViewOut(DismissType reason)
Parameters
Type | Name | Description |
---|---|---|
Dismiss |
reason | The reason why the popup should be dismissed. |
Overrides
Build(VisualElement, VisualElement)
Build a new Tray component.
Declaration
public static Tray Build(VisualElement referenceView, VisualElement content)
Parameters
Type | Name | Description |
---|---|---|
Visual |
referenceView | An arbitrary UI element inside the UI panel. |
Visual |
content | The content to display inside this Tray. |
Returns
Exceptions
Type | Condition |
---|---|
Argument |
If |
GetFocusableElement()
Returns the element that will be focused when the view will become visible.
The default value is `null`.
Declaration
protected override VisualElement GetFocusableElement()
Returns
Type | Description |
---|---|
Visual |
The element that will be focused when the view will become visible. |
Overrides
HideView(DismissType)
Called when it is time to hide the popup.
Declaration
protected override void HideView(DismissType reason)
Parameters
Type | Name | Description |
---|---|---|
Dismiss |
reason | The reason why the popup should be dismissed. |
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
OnLayoutReadyToAnimateIn()
Called when the layout is ready to be animated in.
Declaration
protected override void OnLayoutReadyToAnimateIn()
Overrides
SetHandleVisible(bool)
Set the handle visibility.
Declaration
public Tray SetHandleVisible(bool value)
Parameters
Type | Name | Description |
---|---|---|
bool | value | The handle visibility. |
Returns
SetPosition(TrayPosition)
Build a new Tray component.
Declaration
public Tray SetPosition(TrayPosition position)
Parameters
Type | Name | Description |
---|---|---|
Tray |
position | The position of the tray. |
Returns
SetTransitionDuration(int)
Set the transition duration.
Declaration
public Tray SetTransitionDuration(int durationMs)
Parameters
Type | Name | Description |
---|---|---|
int | durationMs | The transition duration in milliseconds. |
Returns
ShouldAnimate()
Implement this method to know if the popup should call
Animate
Declaration
protected override bool ShouldAnimate()
Returns
Type | Description |
---|---|
bool |
|
Overrides
ShouldDismiss(DismissType)
Dismiss the Popup.
Declaration
protected override bool ShouldDismiss(DismissType reason)
Parameters
Type | Name | Description |
---|---|---|
Dismiss |
reason | Why the element has been dismissed. |
Returns
Type | Description |
---|---|
bool | True if the element has been dismissed. |