Class Popup
This is the base class for any UI component that needs to be displayed over the rest of the user interface.
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: solution.dll
Syntax
public abstract class Popup
Constructors
| Name | Description |
|---|---|
| Popup(VisualElement, ApplicationContext, VisualElement, VisualElement) | Default constructor. |
Fields
| Name | Description |
|---|---|
| k_NextFrameDurationMs | The average duration of a frame in milliseconds. Used to delay position calculations. |
| k_PopupDismiss | The message id used to dismiss the popup. |
| k_PopupShow | The message id used to show the popup. |
Properties
| Name | Description |
|---|---|
| contentView | The content of the popup. |
| context | The ApplicationContext linked to this popup. |
| handler | The handler that receives and dispatches messages. This is useful in multi-threaded applications. |
| keyboardDismissEnabled |
The default value is `True`. |
| targetParent | The parent of the view when the popup will be displayed. |
| view | Returns the popup's VisualElement. |
Methods
| Name | Description |
|---|---|
| AnimateViewIn() | Start the animation for this popup. |
| AnimateViewOut(DismissType) | Start the hide animation for this popup. |
| Dismiss() | Dismiss the Popup. |
| Dismiss(DismissType) | Dismiss the Popup. |
| FindSuitableParent(VisualElement) | Find the parent VisualElement where the popup will be added.
|
| GetFocusableElement() | Returns the element that will be focused when the view will become visible. The default value is `null`. |
| HideView(DismissType) | Called when the popup's Handler has received a k_PopupDismiss message. |
| InvokeDismissedEventHandlers(DismissType) | Called when the popup has completed its dismiss process. |
| InvokeShownEventHandlers() | Called when the popup has become visible. |
| OnViewKeyDown(KeyDownEvent) | Called when the popup has received a KeyDownEvent. By default this method handles the dismiss of the popup via the Escape key or a Return button. |
| ShouldAnimate() | Implement this method to know if the popup should call AnimateViewIn() and AnimateViewOut(DismissType) methods or not. |
| ShouldDismiss(DismissType) | Check if the popup should be dismissed or not, depending on the reason. |
| Show() | Show the Popup. |
| ShowView() | Called when the popup's Handler has received a k_PopupShow message.
|