maui-shell-navigation
यह क्या करती है
यह स्किल Shell का उपयोग करके .NET MAUI ऐप्स में page navigation का मार्गदर्शन देती है, जिसमें tabs, flyout मेनू और pages के बीच routes शामिल हैं। यह उन डेवलपर के लिए है जो MAUI ऐप की navigation संरचना बना रहे हैं।
कब इस्तेमाल करें
- ✓जब आपको MAUI ऐप की मुख्य संरचना के लिए tabs या flyout मेनू चाहिए।
- ✓जब आप code में route के साथ pages के बीच जाना चाहें।
- ✓जब आप बिना सहेजे बदलाव वाले पेज से निकलने से पहले उपयोगकर्ता से पूछना चाहें।
Skill का लिंक
https://github.com/dotnet/skills/blob/main/plugins/dotnet-maui/skills/maui-shell-navigation/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे MAUI ऐप के लिए Shell navigation सेट कीजिए, जिसमें तीन tabs हों और सूची से खुलने वाला एक detail पेज हो।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट XAML फ़ाइल में shell संरचना सेट करता है, detail pages के लिए routes रजिस्टर करता है, और route-आधारित navigation से pages के बीच जाता है, डेटा को parameters के रूप में भेजते हुए।
तकनीकी सामग्री (मूल 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 की बिल्ट-इन navigation संरचना है, जिसमें tabs, flyouts और routes होते हैं।
क्या मैं किसी पेज को डेटा भेज सकता हूँ?
हाँ। डेटा query parameters या object parameters से भेजा जा सकता है।
क्या यह deep links कवर करती है?
नहीं। बाहरी links से आने वाले deep links अलग documentation में कवर होते हैं।
जानकारी
लेखक का मूल विवरण
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
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
create-custom-agent
5.8kयह आपके एजेंट को VS Code के custom agent फ़ाइलें बनाने देती है, जिनके अपने tools, निर्देश और दूसरे agents को handoffs होते हैं।
create-skill
5.8kयह आपके एजेंट को सही नाम, साफ़ trigger विवरण और मानक के अनुसार SKILL.md फ़ाइल वाली नई agent skill बनाने में मदद करती है।
csharp-scripts
5.8kयह आपके एजेंट को .NET command line टूल से एक छोटा C# प्रोग्राम एकल फ़ाइल के रूप में चलाने देती है, पूरा प्रोजेक्ट बनाए बिना।
dotnet-pinvoke
5.8kयह आपके एजेंट को .NET से native C या C++ libraries सही तरीके से कॉल करने में मदद करती है, जिसमें signatures, string संभालना, memory और सुरक्षित handles शामिल हैं।
मिलती-जुलती skills
android-clean-architecture
280kयह आपके एजेंट को Android projects को व्यवस्थित तरीके से संभालने देता है। यह code को ऐसा ढांचा देता है कि उसकी देखभाल और नए features जोड़ना आसान हो।
compose-multiplatform-patterns
280kKMP projects में Compose Multiplatform और Jetpack Compose patterns इस्तेमाल करने में आपके एजेंट की मदद करता है। इसमें state, navigation, theming और performance शामिल हैं।
dart-flutter-patterns
280kयह आपके एजेंट को Dart और Flutter apps के लिए code लिखने देता है। यह आधुनिक patterns इस्तेमाल करके मज़बूत और आसानी से संभलने वाले apps बनाता है।