Back to results for “Navigation”
.NET MAUI › Shell Navigation

How do you register routes for pages not in the Shell visual hierarchy?

Intermediate

Answer

Detail pages that aren't tabs or flyout items must be registered with Routing.RegisterRoute("route", typeof(Page)) in AppShell's constructor. Then GoToAsync("route") can push them. This keeps deep, contextual pages out of the top-level navigation while remaining routable.
public AppShell()
{
    InitializeComponent();
    Routing.RegisterRoute("details", typeof(DetailsPage));
    Routing.RegisterRoute("edit", typeof(EditPage));
}
Real-world example An order-details page and its edit page are registered as routes so they can be pushed from the orders tab but never appear as tabs themselves.

Common follow-ups: Where do you register routes? | What happens if a route is unregistered?