Skip to Content
Version 1Router

Routing and Transitions

LuiDocumentHost can register a root component and route components. LuiRouter is available from mounted components through the protected Router property.

Routes Example

Navigate by route name:

Navigate("Inventory")

Navigate by component type:

Navigate<InventoryScreen>()

Go back:

if (Router == null || !Router.Back()) { Navigate<MainMenuScreen>(); }

Route Names

Each component has a RouteName.

If the serialized route field is blank, the route name defaults to the component type name.

Route Transitions

Built-in transition factories:

LuiRouteTransitions.Instant LuiRouteTransitions.Fade(200f) LuiRouteTransitions.Slide(LuiSlideEdge.Right, 200f)

Host defaults are configured with:

  • LuiRouteTransitionKind.None
  • LuiRouteTransitionKind.Fade
  • LuiRouteTransitionKind.Slide

Individual navigation calls can override the transition:

Navigate<InventoryScreen>(LuiRouteTransitions.Fade(150f));
Last updated on