$npx -y skills add managedcode/dotnet-skills --skill mauiBuild, review, or migrate .NET MAUI applications across Android, iOS, macOS, and Windows with correct cross-platform UI, platform integration, and native packaging assumptions. USE FOR: working on cross-platform mobile or desktop UI in .NET MAUI; integrating device capabilities,
| 1 | # .NET MAUI |
| 2 | |
| 3 | ## Trigger On |
| 4 | |
| 5 | - working on cross-platform mobile or desktop UI in .NET MAUI |
| 6 | - integrating device capabilities, navigation, or platform-specific code |
| 7 | - migrating Xamarin.Forms or aligning a shared codebase across targets |
| 8 | - implementing MVVM patterns in mobile apps |
| 9 | |
| 10 | ## Documentation |
| 11 | |
| 12 | - [.NET MAUI Overview](https://learn.microsoft.com/en-us/dotnet/maui/what-is-maui) |
| 13 | - [Enterprise Patterns](https://learn.microsoft.com/en-us/dotnet/architecture/maui/) |
| 14 | - [MVVM Pattern](https://learn.microsoft.com/en-us/dotnet/architecture/maui/mvvm) |
| 15 | - [Controls Reference](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/) |
| 16 | - [Platform Integration](https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/) |
| 17 | |
| 18 | ### References |
| 19 | |
| 20 | - [patterns.md](references/patterns.md) - Shell navigation, platform-specific code, messaging, lifecycle, data binding, and CollectionView patterns |
| 21 | - [anti-patterns.md](references/anti-patterns.md) - Common MAUI mistakes and how to avoid them |
| 22 | |
| 23 | ## Platform Targets |
| 24 | |
| 25 | | Platform | Build Host | Notes | |
| 26 | |----------|------------|-------| |
| 27 | | Android | Windows/Mac | Emulator or device | |
| 28 | | iOS | Mac only | Requires Xcode | |
| 29 | | macOS | Mac only | Catalyst | |
| 30 | | Windows | Windows | WinUI 3 | |
| 31 | |
| 32 | ## Workflow |
| 33 | |
| 34 | 1. **Confirm target platforms** — behavior differs across Android, iOS, Mac, Windows |
| 35 | 2. **Separate shared UI and platform code** — use handlers and DI |
| 36 | 3. **Follow MVVM pattern** — keep views dumb, logic in ViewModels |
| 37 | 4. **Handle lifecycle and permissions** — platform contracts need testing |
| 38 | 5. **Test on real devices** — emulators don't catch everything |
| 39 | |
| 40 | ## Current Upstream Notes |
| 41 | |
| 42 | - `.NET MAUI` `10.0.71` is a servicing release for the 10.0 line. It includes fixes around HybridWebView/WebView rendering, modal navigation and tab behavior, SafeArea listeners in recycler items, MapPool retention, and platform-specific navigation regressions. |
| 43 | - After upgrading MAUI packages, smoke-test Shell modal navigation, tabs, keyboard interactions, SafeArea layout, maps, WebView/HybridWebView, and accessibility narration on the target platforms. |
| 44 | - The July 2026 `.NET MAUI` Learn overview for `net-maui-10.0` still frames the platform around a shared single-project app, native API access, handlers, and optional Blazor Hybrid UI. Verify each target platform rather than treating shared code as identical runtime behavior. |
| 45 | |
| 46 | ## Project Structure |
| 47 | |
| 48 | ``` |
| 49 | MyApp/ |
| 50 | ├── MyApp/ # Shared code |
| 51 | │ ├── App.xaml # Application entry |
| 52 | │ ├── MauiProgram.cs # DI and configuration |
| 53 | │ ├── Views/ # XAML pages |
| 54 | │ ├── ViewModels/ # MVVM ViewModels |
| 55 | │ ├── Models/ # Domain models |
| 56 | │ ├── Services/ # Business logic |
| 57 | │ └── Platforms/ # Platform-specific code |
| 58 | │ ├── Android/ |
| 59 | │ ├── iOS/ |
| 60 | │ ├── MacCatalyst/ |
| 61 | │ └── Windows/ |
| 62 | └── MyApp.Tests/ |
| 63 | ``` |
| 64 | |
| 65 | ## MVVM Pattern |
| 66 | |
| 67 | ### ViewModel with MVVM Toolkit |
| 68 | ```csharp |
| 69 | public partial class ProductsViewModel(IProductService productService) : ObservableObject |
| 70 | { |
| 71 | [ObservableProperty] |
| 72 | private ObservableCollection<Product> _products = []; |
| 73 | |
| 74 | [ObservableProperty] |
| 75 | [NotifyCanExecuteChangedFor(nameof(LoadProductsCommand))] |
| 76 | private bool _isLoading; |
| 77 | |
| 78 | [RelayCommand(CanExecute = nameof(CanLoadProducts))] |
| 79 | private async Task LoadProductsAsync() |
| 80 | { |
| 81 | IsLoading = true; |
| 82 | try |
| 83 | { |
| 84 | var items = await productService.GetAllAsync(); |
| 85 | Products = new ObservableCollection<Product>(items); |
| 86 | } |
| 87 | finally |
| 88 | { |
| 89 | IsLoading = false; |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | private bool CanLoadProducts() => !IsLoading; |
| 94 | } |
| 95 | ``` |
| 96 | |
| 97 | ### View Binding |
| 98 | ```xml |
| 99 | <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
| 100 | xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
| 101 | xmlns:vm="clr-namespace:MyApp.ViewModels" |
| 102 | x:Class="MyApp.Views.ProductsPage" |
| 103 | x:DataType="vm:ProductsViewModel"> |
| 104 | |
| 105 | <RefreshView Command="{Binding LoadProductsCommand}" |
| 106 | IsRefreshing="{Binding IsLoading}"> |
| 107 | <CollectionView ItemsSource="{Binding Products}"> |
| 108 | <CollectionView.ItemTemplate> |
| 109 | <DataTemplate x:DataType="models:Product"> |
| 110 | <VerticalStackLayout Padding="10"> |