Class NavigationScreen
Base class for all navigation screens.
A navigation screen is a VisualElement that can be pushed to a NavHost.
Classes that inherit from this class can be used as template in a NavDestination
with the value of typeof(YourScreenType).AssemblyQualifiedName.
Implements
Inherited Members
Namespace: Unity.AppUI.Navigation
Assembly: Unity.AppUI.Navigation.dll
Syntax
public class NavigationScreen : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle
Constructors
NavigationScreen()
Base Constructor.
Declaration
public NavigationScreen()
Fields
containerUssClassName
The NavigationScreen container styling class.
Declaration
public static readonly string containerUssClassName
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The NavigationScreen main styling class.
Declaration
public static readonly string ussClassName
Field Value
| Type | Description |
|---|---|
| string |
withAppBarUssClassName
The NavigationScreen with app bar styling class.
Declaration
public static readonly string withAppBarUssClassName
Field Value
| Type | Description |
|---|---|
| string |
withCompactAppBarUssClassName
The NavigationScreen with compact app bar styling class.
Declaration
public static readonly string withCompactAppBarUssClassName
Field Value
| Type | Description |
|---|---|
| string |
Properties
contentContainer
Child elements are added to this element.
Declaration
public override VisualElement contentContainer { get; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
Overrides
scrollView
The ScrollView that will be used to display the content of the screen.
Declaration
public ScrollView scrollView { get; }
Property Value
| Type | Description |
|---|---|
| ScrollView |
Methods
OnEnter(NavController, NavDestination, Argument[])
Called when the screen is pushed to a NavHost.
Declaration
protected virtual void OnEnter(NavController controller, NavDestination destination, Argument[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| NavController | controller | The NavController that manages the navigation stack. |
| NavDestination | destination | The NavDestination associated with this screen. |
| Argument[] | args | The arguments associated with this screen. |
OnExit(NavController, NavDestination, Argument[])
Called when the screen is popped from a NavHost.
Declaration
protected virtual void OnExit(NavController controller, NavDestination destination, Argument[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| NavController | controller | The NavController that manages the navigation stack. |
| NavDestination | destination | The NavDestination associated with this screen. |
| Argument[] | args | The arguments associated with this screen. |
Remarks
This method is called before the screen is removed from the NavHost.
SetupAppBar(AppBar)
Implement this method to setup the AppBar of this screen specifically.
Declaration
protected virtual void SetupAppBar(AppBar appBar)
Parameters
| Type | Name | Description |
|---|---|---|
| AppBar | appBar | The AppBar to setup. |
Remarks
To setup the AppBar globally, use SetupAppBar(AppBar, NavDestination, NavController) in your implementation of INavVisualController.
SetupBottomNavBar(BottomNavBar)
Implement this method to setup the BottomNavBar of this screen specifically.
Declaration
protected virtual void SetupBottomNavBar(BottomNavBar bottomNavBar)
Parameters
| Type | Name | Description |
|---|---|---|
| BottomNavBar | bottomNavBar | The BottomNavBar to setup. |
Remarks
To setup the BottomNavBar globally, use SetupBottomNavBar(BottomNavBar, NavDestination, NavController) in your implementation of INavVisualController.
SetupDrawer(Drawer)
Implement this method to setup the Drawer of this screen specifically.
Declaration
protected virtual void SetupDrawer(Drawer drawer)
Parameters
| Type | Name | Description |
|---|---|---|
| Drawer | drawer | The Drawer to setup. |
Remarks
To setup the Drawer globally, use SetupDrawer(Drawer, NavDestination, NavController) in your implementation of INavVisualController.