.NET MAUI Shell Navigation
Implement page navigation in .NET MAUI apps using Shell. Shell provides URI-based navigation, a flyout menu, tab bars, and a four-level visual hierarchy — all configured declaratively in XAML.
When to Use
- Setting up top-level app navigation with tabs or a flyout menu
- Navigating between pages programmatically with
GoToAsync - Passing data between pages via query parameters or object parameters
- Registering detail-page routes for push navigation
- Guarding navigation with confirmation dialogs (e.g., unsaved changes)
- Customizing back button behavior per page
When Not to Use
- Deep linking from external URLs or app links — see .NET MAUI deep linking docs
- Data binding on navigation target pages — use
maui-data-binding - Dependency injection for pages and view models — use
maui-dependency-injection - Apps using
NavigationPagewithout Shell (different navigation API)
Inputs
- A .NET MAUI project with
AppShell.xamlas the root shell - Pages (
ContentPage) to navigate between - Route names for detail pages not in the visual hierarchy
Rules That Change the Answer
These are the Shell-specific decisions that are easy to get wrong. Apply them whenever they are relevant to what the user asked.
Do not propose NavigationPage / PushAsync solutions for a Shell app, and do
not restructure a working AppShell hierarchy unless the user asked.
Answer narrowly, but completely. Staying on topic does not mean being terse. When
you show a navigation change, include the pieces needed to run it: the AppShell.xaml
markup and the Routing.RegisterRoute call, or the GoToAsync call and the
receiving IQueryAttributable / [QueryProperty] code. Where two approaches are both
valid (query string vs ShellNavigationQueryParameters), show both and say when each
fits — a single snippet the user still has to complete is a worse answer.
Shell Visual Hierarchy
Shell uses a four-level hierarchy. Each level wraps the one below it:
- FlyoutItem — appears in the flyout menu; contains
Tabchildren - TabBar — bottom tab bar with no flyout entry
- Tab — groups
ShellContent; multiple children produce top tabs - ShellContent — each points to a
ContentPage
Implicit Conversion
You can omit intermediate wrappers. Shell auto-wraps:
Workflow: Set Up AppShell
- Define
AppShell.xamlinheriting fromShell - Add
FlyoutItemorTabBarelements for top-level navigation - Add
Tabelements for bottom tabs; nest multipleShellContentfor top tabs - Always use
ContentTemplatewithDataTemplateso pages load on demand - Give every
ShellContentan explicitRoute(see below) - Register detail-page routes in the
AppShellconstructor
Set
Route=on everyShellContent. If you omit it, MAUI auto-generates a name from a shared counter —Routing.csproducesD_FAULT_{TypeName}{n}. A real shell with three unnamedShellContentelements yields routes likeD_FAULT_ShellContent2andD_FAULT_ShellContent5: the numbers are not sequential, they depend on how many Shell elements were constructed first, and they shift when you reorder or add pages. You cannot write a stable absolute route (//dashboard) or deep link against that. An explicitRoute="dashboard"is stable forever.
Workflow: Navigate with GoToAsync
All programmatic navigation uses Shell.Current.GoToAsync. Always await the call.
Route Prefixes
Navigation Examples
Workflow: Pass Data Between Pages
Option 1: IQueryAttributable (Preferred)
Implement on ViewModels to receive all parameters in one call:
Option 2: QueryProperty Attribute
Apply on the ViewModel class (or the page, if it genuinely owns the state).
Prefer IQueryAttributable on the ViewModel — it keeps navigation state with the
BindingContext and handles multiple parameters in one call:
Shell applies query attributes after the page constructor sets BindingContext,
so the property must raise change notification — a plain auto-property leaves the
binding stuck on its initial value.
Option 3: Complex Objects via ShellNavigationQueryParameters
Pass objects without serializing to strings:
Receive via IQueryAttributable:
Workflow: Guard Navigation
Use GetDeferral() in OnNavigating for async checks (e.g., "save unsaved changes?"):
Tab Configuration
Bottom Tabs
Multiple ShellContent (or Tab) children inside a TabBar or FlyoutItem produce bottom tabs.
Top Tabs
Multiple ShellContent children inside a single Tab produce top tabs:
Tab Bar Appearance
Flyout Configuration
FlyoutBehavior
Set on Shell: Disabled, Flyout, or Locked.
FlyoutDisplayOptions
Controls how children appear in the flyout:
AsSingleItem(default) — one flyout entry for the groupAsMultipleItems— each childTabgets its own entry
MenuItem (Non-Navigation Flyout Entries)
Back Button Behavior
Customize the back button per page:
Properties: Command, CommandParameter, IconOverride, TextOverride, IsVisible, IsEnabled.
Inspecting Navigation State
Navigation Events
Override in AppShell:
ShellNavigationSource values: Push, Pop, PopToRoot, Insert, Remove, ShellItemChanged, ShellSectionChanged, ShellContentChanged, Unknown.
Common Pitfalls
- Eager page creation: Using
Contentdirectly instead ofContentTemplatewithDataTemplatecreates all pages at Shell init, hurting startup time. Always useContentTemplate. - Duplicate route names:
Routing.RegisterRoutethrowsArgumentExceptionif a route name matches an existing route or a visual hierarchy route. Every route must be unique across the app. - Relative routes without registration: You cannot
GoToAsync("somepage")unlesssomepagewas registered withRouting.RegisterRoute. Visual hierarchy pages use absolute//routes. - Fire-and-forget GoToAsync: Not awaiting
GoToAsynccauses race conditions and silent failures. Alwaysawaitthe call. - Wrong absolute route path: Absolute routes must match the full path through the visual hierarchy (
//FlyoutItem/Tab/ShellContent). Wrong paths produce silent no-ops, not exceptions. - Manipulating Tab.Stack directly: The navigation stack is read-only. Use
GoToAsyncfor all navigation changes. - Forgetting
GetDeferral()for async guards: Synchronous cancellation inOnNavigatingworks, but async checks requireGetDeferral()/deferral.Complete()to avoid race conditions.
References
references/shell-navigation-api.md— Full API reference for Shell hierarchy, routes, tabs, flyout, and navigation- .NET MAUI Shell Navigation
- .NET MAUI Shell Tabs
- .NET MAUI Shell Flyout
- .NET MAUI Shell Pages


