maui-shell-navigation
Что он делает
Этот скилл направляет навигацию между страницами в приложениях .NET MAUI с помощью Shell, включая вкладки, выпадающее меню и маршруты между страницами. Он нужен разработчикам, которые строят структуру навигации приложения MAUI.
Когда использовать
- ✓Когда вам нужны вкладки или выпадающее меню для основной структуры приложения MAUI.
- ✓Когда вы хотите переходить между страницами в коде по маршруту.
- ✓Когда нужно спросить пользователя, прежде чем уйти со страницы с несохранёнными изменениями.
Ссылка на скилл
https://github.com/dotnet/skills/blob/main/plugins/dotnet-maui/skills/maui-shell-navigation/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Настрой навигацию Shell для моего приложения MAUI: три вкладки и страница деталей, которая открывается из списка.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Агент настраивает структуру shell в файле XAML, регистрирует маршруты для страниц деталей и использует навигацию по маршрутам, передавая данные как параметры.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с 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
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.
| 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 |
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:
Shell
├── FlyoutItem / TabBar (top-level grouping)
│ ├── Tab (bottom-tab grouping)
│ │ ├── ShellContent (page slot → ContentPage)
│ │ └── ShellContent (multiple = top tabs)
│ └── Tab
└── FlyoutItem / TabBar
- 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:
| You write | Shell creates |
|---|---|
ShellContent only |
FlyoutItem > Tab > ShellContent |
Tab only |
FlyoutItem > Tab |
ShellContent in TabBar |
TabBar > Tab > ShellContent |
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 `Content
Частые вопросы
Что такое Shell?
Shell — это встроенная структура навигации в .NET MAUI с вкладками, выпадающими меню и маршрутами.
Можно ли передать данные на страницу?
Да. Данные можно передать через параметры запроса или параметры-объекты.
Он охватывает глубокие ссылки?
Нет. Глубокие ссылки из внешних ссылок описываются отдельной документацией.
Подробности
Оригинальное описание автора
Guide for implementing Shell-based navigation in .NET MAUI apps. Covers AppShell setup, visual hierarchy (FlyoutItem, TabBar, Tab, ShellContent), URI-based navigation with GoToAsync, route registration, query parameters, back navigation, flyout and tab configuration, navigation events, and navigation guards. Use when: setting up Shell navigation, adding tabs or flyout menus, navigating between pages with GoToAsync, passing parameters between pages, registering routes, customizing back button behavior, or guarding navigation with confirmation dialogs. Do not use for: deep linking from external
repo: dotnet/skills
Популярность
- Звёзды на GitHub
- 5.8k
- Место в рейтинге
- #14588
- Лицензия
- MIT
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
create-custom-agent
5.8kПомогает агенту создавать файлы пользовательских агентов для VS Code со своими инструментами, инструкциями и передачей работы другим агентам.
create-skill
5.8kПомогает агенту создать новый скилл с корректным именем, понятным описанием триггера и файлом SKILL.md по стандарту.
csharp-scripts
5.8kПомогает агенту запустить небольшую программу на C# как один файл с помощью командного инструмента .NET, без создания полного проекта.
dotnet-pinvoke
5.8kПомогает агенту правильно вызывать нативные библиотеки C и C++ из .NET: сигнатуры, работу со строками, память и безопасные дескрипторы.
Похожие скиллы
android-clean-architecture
280kПомогает агенту эффективно организовывать Android-проекты. Структурирует код, чтобы его было проще поддерживать и развивать.
compose-multiplatform-patterns
280kПомогает агенту применять паттерны Compose Multiplatform и Jetpack Compose в KMP-проектах: состояние, навигация, темы и производительность.
dart-flutter-patterns
280kАгент пишет код для приложений на Dart и Flutter по современным паттернам, чтобы они были надёжными и управляемыми.