maui-shell-navigation

A guide to Shell navigation in .NET MAUI, where an app declares its pages, tabs, and flyout menu in XAML and moves between screens using route-like names. It covers passing values between pages and controlling back navigation.

In plain words
What is it for?
Use it to configure AppShell, create tabs or flyout menus, navigate with GoToAsync, register detail-page routes, pass query parameters, and guard navigation when changes might be lost.
Why use it?
It removes guesswork around setting up the app's navigation structure and registering pages that are not directly visible in the main menu. It also helps handle confirmation prompts and custom back-button behavior.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/managedcode/dotnet-skills/maui-shell-navigation
Any agent
npx skills add managedcode/dotnet-skills --skill maui-shell-navigation
Clone the repo
git clone --depth 1 https://github.com/managedcode/dotnet-skills

Made for: Claude Code, Codex.

Per session 164 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,559 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00164 $0.03559
Opus 5 $0.00082 $0.01780
Sonnet 5 $0.00033 $0.00712
Haiku 4.5 $0.00016 $0.00356

Measured 2d ago against content hash ec498df37255, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

maui-shell-navigation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to maui-shell-navigation — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

catalog/Frameworks/Official-DotNet-MAUI/skills/maui-shell-navigation/SKILL.md · 391 lines

How it starts

The opening of the file, as written. The whole thing — 391 lines — stays where its author put it; the contents beside it link to each section on GitHub.

.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 NavigationPage without Shell (different navigation API)

Inputs

  • A .NET MAUI project with AppShell.xaml as 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.

Situation Do this Not this
Declaring pages in AppShell.xaml With xmlns:views="clr-namespace:MyApp.Views" declared: <ShellContent ContentTemplate="{DataTemplate views:MyPage}" /> — the page is created on first navigation <ShellContent><views:MyPage /></ShellContent>, which constructs every page at startup
Navigating to a page not in the visual hierarchy Routing.RegisterRoute("details", typeof(DetailsPage)) first Calling GoToAsync("details") unregistered — it throws at runtime
Receiving navigation parameters Implement IQueryAttributable on the ViewModel Implementing it on the Page, which splits state from the BindingContext
Passing a whole object ShellNavigationQueryParameters Serialising the object into the query string
Any GoToAsync call await it Fire-and-forget — exceptions are swallowed and navigation races
Confirming before back navigation ShellNavigatingEventArgs.GetDeferral()deferral.Complete() Blocking synchronously on the dialog task
Detecting back navigation Check e.Source == ShellNavigationSource.Pop Assuming every navigation is a back action

Read the full file on GitHub · 391 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 391 lines · 164 tokens per session scan A ec498df37255

Subscribe to this mod's changes

maui-shell-navigation is a skill published in the GitHub repository managedcode/dotnet-skills (477 stars, last pushed 3d ago), licensed MIT. It adds 164 tokens to every session and 3,559 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to maui-shell-navigation, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

comet-go

Write and edit Comet Go single-file apps (.cs files using the Comet MVU framework for .NET MAUI). Use when writing, editing, or debugging Comet Go apps, or when the user mentions "maui go", "comet go", or is working with .cs files that import Comet.

dotnet/maui-labs · 69 tokens

android-slim-bindings

Create Android slim bindings for MAUI/.NET Android. USE FOR: slim Android binding, Kotlin/Java wrappers, build.gradle.kts, Maven, AAR/JAR, AndroidMavenLibrary, AndroidLibrary, @JvmStatic, XA4241/XA4242, Xamarin.AndroidX/Kotlin NuGets. DO NOT USE FOR: iOS/macOS bindings, general MAUI apps, or NuGet packaging.

dotnet/maui-labs · 90 tokens

ios-slim-bindings

Create iOS slim bindings for MAUI. USE FOR: slim iOS binding, Native Library Interop, Swift/Objective-C wrappers, XcodeGen project.yml, Podfile, CocoaPods static linking, BUILDLIBRARYFORDISTRIBUTION, XcodeProject MSBuild, @objc/[Export] selector crashes, async completion handlers. DO NOT USE FOR: Android bindings…

dotnet/maui-labs · 97 tokens

xamarin-forms-migration

Plan Xamarin.Forms to .NET MAUI migrations. USE FOR: audits, fresh dotnet new maui, Xamarin.Forms/Xamarin.Essentials namespace updates, DependencyService to DI, MessagingCenter to WeakReferenceMessenger/events, renderer triage into mapper/custom handler/platform service/slim binding, MauiProgram, permissions, parity.…

dotnet/maui-labs · 102 tokens

maui-app-architecture

Design .NET MAUI architecture around DI, MVVM, compiled bindings, Shell navigation, route registration, query parameters, and testable services. USE FOR: MauiProgram service registration, page/ViewModel wiring, Shell GoToAsync, Routing.RegisterRoute, trim-safe IQueryAttributable vs [QueryProperty] for full…

dotnet/maui-labs · 130 tokens

maui-controls-deep-dive

Apply advanced MAUI control guidance. USE FOR: CollectionView incremental loading, RemainingItemsThreshold, EmptyView, AutomationId, avoiding ScrollView wrappers, SafeAreaEdges on .NET 10, GraphicsView/IDrawable/Invalidate hot-path performance, gestures, animations. DO NOT USE FOR: general layout, full accessibility…

dotnet/maui-labs · 95 tokens