$npx -y skills add managedcode/dotnet-skills --skill uno-platformBuild cross-platform .NET applications with Uno Platform targeting WebAssembly, iOS, Android, macOS, Linux, and Windows from a single XAML/C# codebase. USE FOR: building cross-platform apps from a single C# and XAML codebase; targeting WebAssembly, iOS, Android, macOS, Linux, and
| 1 | # Uno Platform |
| 2 | |
| 3 | ## Trigger On |
| 4 | |
| 5 | - building cross-platform apps from a single C# and XAML codebase |
| 6 | - targeting WebAssembly, iOS, Android, macOS, Linux, and Windows simultaneously |
| 7 | - migrating WPF or UWP applications to cross-platform |
| 8 | - implementing pixel-perfect UI across all platforms |
| 9 | - using WinUI/UWP APIs on non-Windows platforms |
| 10 | |
| 11 | ## Documentation |
| 12 | |
| 13 | - [Uno Platform Overview](https://platform.uno/docs/articles/intro.html) |
| 14 | - [Getting Started](https://platform.uno/docs/articles/get-started.html?tabs=windows) |
| 15 | - [Using Uno Platform with WinUI](https://platform.uno/docs/articles/winui-doc-links.html) |
| 16 | - [Platform-Specific Code](https://platform.uno/docs/articles/platform-specific-xaml.html) |
| 17 | - [MVUX Pattern](https://platform.uno/docs/articles/external/uno.extensions/doc/Overview/Mvux/Overview.html) |
| 18 | |
| 19 | ## References |
| 20 | |
| 21 | See detailed examples in the `references/` folder: |
| 22 | - [`patterns.md`](references/patterns.md) — MVUX, XAML, navigation, and performance patterns |
| 23 | |
| 24 | ## Platform Support |
| 25 | |
| 26 | | Platform | Rendering | Notes | |
| 27 | |----------|-----------|-------| |
| 28 | | Windows | WinUI 3 | Native Windows App SDK | |
| 29 | | WebAssembly | Skia/Canvas | Runs in browser | |
| 30 | | iOS | Skia/Metal | Native iOS app | |
| 31 | | Android | Skia/OpenGL | Native Android app | |
| 32 | | macOS | Skia/Metal | Mac Catalyst or AppKit | |
| 33 | | Linux | Skia/X11 | GTK or Framebuffer | |
| 34 | |
| 35 | ## Workflow |
| 36 | |
| 37 | 1. **Choose the right template** — Uno Platform offers various templates for different scenarios |
| 38 | 2. **Understand rendering modes** — Skia vs native rendering affects performance and fidelity |
| 39 | 3. **Apply MVVM or MVUX patterns** — keep views dumb, logic in ViewModels |
| 40 | 4. **Handle platform differences** — use conditional XAML or partial classes |
| 41 | 5. **Test on all target platforms** — behavior varies across platforms |
| 42 | |
| 43 | ## Project Structure |
| 44 | |
| 45 | ``` |
| 46 | MyApp/ |
| 47 | ├── MyApp/ # Shared code |
| 48 | │ ├── App.xaml # Application entry |
| 49 | │ ├── MainPage.xaml # Main page |
| 50 | │ ├── Presentation/ # ViewModels (MVUX/MVVM) |
| 51 | │ ├── Business/ # Business logic |
| 52 | │ └── Services/ # Platform services |
| 53 | ├── MyApp.Wasm/ # WebAssembly head |
| 54 | ├── MyApp.Mobile/ # iOS and Android head |
| 55 | ├── MyApp.Skia.Gtk/ # Linux head |
| 56 | ├── MyApp.Skia.WPF/ # Windows Skia head |
| 57 | └── MyApp.Windows/ # Native WinUI head |
| 58 | ``` |
| 59 | |
| 60 | ## MVUX Pattern (Uno Extensions) |
| 61 | |
| 62 | ### Model Definition |
| 63 | ```csharp |
| 64 | public partial record MainModel |
| 65 | { |
| 66 | public IListFeed<TodoItem> Items => ListFeed.Async(LoadItems); |
| 67 | |
| 68 | private async ValueTask<IImmutableList<TodoItem>> LoadItems(CancellationToken ct) |
| 69 | { |
| 70 | var items = await _todoService.GetAllAsync(ct); |
| 71 | return items.ToImmutableList(); |
| 72 | } |
| 73 | } |
| 74 | ``` |
| 75 | |
| 76 | ### View Binding with FeedView |
| 77 | ```xml |
| 78 | <Page xmlns:uen="using:Uno.Extensions.Navigation.UI"> |
| 79 | <utu:FeedView Source="{Binding Items}"> |
| 80 | <utu:FeedView.ValueTemplate> |
| 81 | <DataTemplate> |
| 82 | <ListView ItemsSource="{Binding}"> |
| 83 | <ListView.ItemTemplate> |
| 84 | <DataTemplate x:DataType="local:TodoItem"> |
| 85 | <TextBlock Text="{Binding Title}" /> |
| 86 | </DataTemplate> |
| 87 | </ListView.ItemTemplate> |
| 88 | </ListView> |
| 89 | </DataTemplate> |
| 90 | </utu:FeedView.ValueTemplate> |
| 91 | <utu:FeedView.ProgressTemplate> |
| 92 | <DataTemplate> |
| 93 | <ProgressRing IsActive="True" /> |
| 94 | </DataTemplate> |
| 95 | </utu:FeedView.ProgressTemplate> |
| 96 | </utu:FeedView> |
| 97 | </Page> |
| 98 | ``` |
| 99 | |
| 100 | ## Classic MVVM with MVVM Toolkit |
| 101 | |
| 102 | ### ViewModel |
| 103 | ```csharp |
| 104 | public partial class MainViewModel(ITodoService todoService) : ObservableObject |
| 105 | { |
| 106 | [ObservableProperty] |
| 107 | private ObservableCollection<TodoItem> _items = []; |
| 108 | |
| 109 | [ObservableProperty] |
| 110 | private bool _isLoading; |
| 111 | |
| 112 | [RelayCommand] |
| 113 | private async Task LoadItemsAsync() |
| 114 | { |
| 115 | IsLoading = true; |
| 116 | try |
| 117 | { |
| 118 | var items = await todoService.GetAllAsync(); |
| 119 | Items = new ObservableCollection<TodoItem>(items); |
| 120 | } |
| 121 | finally |
| 122 | { |
| 123 | IsLoading = false; |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | ``` |
| 128 | |
| 129 | ## Platform-Specific Code |
| 130 | |
| 131 | ### Conditional XAML |
| 132 | ```xml |
| 133 | <TextBlock Text="Welcome" |
| 134 | xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 135 | xmlns:android="http://uno.ui/andro |