{"slug":"dotnet-uno-platform","title":"dotnet-uno-platform","summary":"Build cross-platform .NET applications with Uno Platform targeting WebAssembly, iOS, Android, macOS, Linux, and Windows from a single XAML/C# codebase.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-27T21:00:40.234646Z","repo":{"url":"https://github.com/Postpartum-genushyacinthus29/dotnet-skills","stars":13,"forks":1,"license":"MIT","updatedAt":"2026-10-13T07:00:47Z"},"bodyHtml":"<hr>\n<h2>name: dotnet-uno-platform\nversion: \"1.0.0\"\ncategory: \"Cross-Platform UI\"\ndescription: \"Build cross-platform .NET applications with Uno Platform targeting WebAssembly, iOS, Android, macOS, Linux, and Windows from a single XAML/C# codebase.\"\ncompatibility: \"Requires Uno Platform SDK and workloads for target platforms.\"</h2>\n<h1>Uno Platform</h1>\n<h2>Trigger On</h2>\n<ul>\n<li>building cross-platform apps from a single C# and XAML codebase</li>\n<li>targeting WebAssembly, iOS, Android, macOS, Linux, and Windows simultaneously</li>\n<li>migrating WPF or UWP applications to cross-platform</li>\n<li>implementing pixel-perfect UI across all platforms</li>\n<li>using WinUI/UWP APIs on non-Windows platforms</li>\n</ul>\n<h2>Documentation</h2>\n<ul>\n<li><a href=\"https://platform.uno/docs/articles/intro.html\">Uno Platform Overview</a></li>\n<li><a href=\"https://platform.uno/docs/articles/getting-started.html\">Getting Started</a></li>\n<li><a href=\"https://platform.uno/docs/articles/winui-doc-links.html\">Using Uno Platform with WinUI</a></li>\n<li><a href=\"https://platform.uno/docs/articles/platform-specific-xaml.html\">Platform-Specific Code</a></li>\n<li><a href=\"https://platform.uno/docs/articles/external/uno.extensions/doc/Overview/Mvux/Overview.html\">MVUX Pattern</a></li>\n</ul>\n<h2>References</h2>\n<p>See detailed examples in the <code>references/</code> folder:</p>\n<ul>\n<li><a href=\"references/patterns.md\"><code>patterns.md</code></a> — MVUX, XAML, navigation, and performance patterns</li>\n</ul>\n<h2>Platform Support</h2>\n<table>\n<thead>\n<tr>\n<th>Platform</th>\n<th>Rendering</th>\n<th>Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Windows</td>\n<td>WinUI 3</td>\n<td>Native Windows App SDK</td>\n</tr>\n<tr>\n<td>WebAssembly</td>\n<td>Skia/Canvas</td>\n<td>Runs in browser</td>\n</tr>\n<tr>\n<td>iOS</td>\n<td>Skia/Metal</td>\n<td>Native iOS app</td>\n</tr>\n<tr>\n<td>Android</td>\n<td>Skia/OpenGL</td>\n<td>Native Android app</td>\n</tr>\n<tr>\n<td>macOS</td>\n<td>Skia/Metal</td>\n<td>Mac Catalyst or AppKit</td>\n</tr>\n<tr>\n<td>Linux</td>\n<td>Skia/X11</td>\n<td>GTK or Framebuffer</td>\n</tr>\n</tbody>\n</table>\n<h2>Workflow</h2>\n<ol>\n<li><strong>Choose the right template</strong> — Uno Platform offers various templates for different scenarios</li>\n<li><strong>Understand rendering modes</strong> — Skia vs native rendering affects performance and fidelity</li>\n<li><strong>Apply MVVM or MVUX patterns</strong> — keep views dumb, logic in ViewModels</li>\n<li><strong>Handle platform differences</strong> — use conditional XAML or partial classes</li>\n<li><strong>Test on all target platforms</strong> — behavior varies across platforms</li>\n</ol>\n<h2>Project Structure</h2>\n<pre><code>MyApp/\n├── MyApp/                    # Shared code\n│   ├── App.xaml              # Application entry\n│   ├── MainPage.xaml         # Main page\n│   ├── Presentation/         # ViewModels (MVUX/MVVM)\n│   ├── Business/             # Business logic\n│   └── Services/             # Platform services\n├── MyApp.Wasm/               # WebAssembly head\n├── MyApp.Mobile/             # iOS and Android head\n├── MyApp.Skia.Gtk/           # Linux head\n├── MyApp.Skia.WPF/           # Windows Skia head\n└── MyApp.Windows/            # Native WinUI head\n</code></pre>\n<h2>MVUX Pattern (Uno Extensions)</h2>\n<h3>Model Definition</h3>\n<pre><code>public partial record MainModel\n{\n    public IListFeed&lt;TodoItem&gt; Items =&gt; ListFeed.Async(LoadItems);\n\n    private async ValueTask&lt;IImmutableList&lt;TodoItem&gt;&gt; LoadItems(CancellationToken ct)\n    {\n        var items = await _todoService.GetAllAsync(ct);\n        return items.ToImmutableList();\n    }\n}\n</code></pre>\n<h3>View Binding with FeedView</h3>\n<pre><code>&lt;Page xmlns:uen=\"using:Uno.Extensions.Navigation.UI\"&gt;\n    &lt;utu:FeedView Source=\"{Binding Items}\"&gt;\n        &lt;utu:FeedView.ValueTemplate&gt;\n            &lt;DataTemplate&gt;\n                &lt;ListView ItemsSource=\"{Binding}\"&gt;\n                    &lt;ListView.ItemTemplate&gt;\n                        &lt;DataTemplate x:DataType=\"local:TodoItem\"&gt;\n                            &lt;TextBlock Text=\"{Binding Title}\" /&gt;\n                        &lt;/DataTemplate&gt;\n                    &lt;/ListView.ItemTemplate&gt;\n                &lt;/ListView&gt;\n            &lt;/DataTemplate&gt;\n        &lt;/utu:FeedView.ValueTemplate&gt;\n        &lt;utu:FeedView.ProgressTemplate&gt;\n            &lt;DataTemplate&gt;\n                &lt;ProgressRing IsActive=\"True\" /&gt;\n            &lt;/DataTemplate&gt;\n        &lt;/utu:FeedView.ProgressTemplate&gt;\n    &lt;/utu:FeedView&gt;\n&lt;/Page&gt;\n</code></pre>\n<h2>Classic MVVM with MVVM Toolkit</h2>\n<h3>ViewModel</h3>\n<pre><code>public partial class MainViewModel(ITodoService todoService) : ObservableObject\n{\n    [ObservableProperty]\n    private ObservableCollection&lt;TodoItem&gt; _items = [];\n\n    [ObservableProperty]\n    private bool _isLoading;\n\n    [RelayCommand]\n    private async Task LoadItemsAsync()\n    {\n        IsLoading = true;\n        try\n        {\n            var items = await todoService.GetAllAsync();\n            Items = new ObservableCollection&lt;TodoItem&gt;(items);\n        }\n        finally\n        {\n            IsLoading = false;\n        }\n    }\n}\n</code></pre>\n<h2>Platform-Specific Code</h2>\n<h3>Conditional XAML</h3>\n<pre><code>&lt;TextBlock Text=\"Welcome\"\n           xmlns:win=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n           xmlns:android=\"http://uno.ui/android\"\n           xmlns:ios=\"http://uno.ui/ios\"\n           xmlns:wasm=\"http://uno.ui/wasm\"&gt;\n\n    &lt;win:TextBlock.Foreground&gt;\n        &lt;SolidColorBrush Color=\"Blue\" /&gt;\n    &lt;/win:TextBlock.Foreground&gt;\n\n    &lt;android:TextBlock.Foreground&gt;\n        &lt;SolidColorBrush Color=\"Green\" /&gt;\n    &lt;/android:TextBlock.Foreground&gt;\n&lt;/TextBlock&gt;\n</code></pre>\n<h3>Partial Classes</h3>\n<pre><code>// Services/DeviceService.cs (shared)\npublic partial class DeviceService\n{\n    public partial string GetDeviceInfo();\n}\n\n// Services/DeviceService.wasm.cs\npublic partial class DeviceService\n{\n    public partial string GetDeviceInfo() =&gt; \"WebAssembly\";\n}\n\n// Services/DeviceService.Android.cs\npublic partial class DeviceService\n{\n    public partial string GetDeviceInfo() =&gt;\n        $\"Android {Android.OS.Build.VERSION.Release}\";\n}\n</code></pre>\n<h2>Hot Reload and Development</h2>\n<pre><code>// Enable Hot Reload in App.xaml.cs\npublic App()\n{\n    this.InitializeComponent();\n\n#if DEBUG\n    // Enable Hot Reload\n    this.EnableHotReload();\n#endif\n}\n</code></pre>\n<h2>Anti-Patterns to Avoid</h2>\n<table>\n<thead>\n<tr>\n<th>Anti-Pattern</th>\n<th>Why It's Bad</th>\n<th>Better Approach</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Platform code in shared</td>\n<td>Breaks compilation</td>\n<td>Use partial classes or #if</td>\n</tr>\n<tr>\n<td>Ignoring Skia differences</td>\n<td>Visual bugs</td>\n<td>Test on all renderers</td>\n</tr>\n<tr>\n<td>WPF assumptions</td>\n<td>Not all APIs exist</td>\n<td>Check Uno API coverage</td>\n</tr>\n<tr>\n<td>Heavy XAML</td>\n<td>Slow on WASM</td>\n<td>Virtualize, simplify</td>\n</tr>\n<tr>\n<td>Synchronous loading</td>\n<td>UI freezes</td>\n<td>Always use async</td>\n</tr>\n</tbody>\n</table>\n<h2>Performance Best Practices</h2>\n<ol>\n<li><p><strong>Use virtualized lists:</strong></p>\n<pre><code>&lt;ListView ItemsSource=\"{Binding Items}\"\n          VirtualizingPanel.VirtualizationMode=\"Recycling\" /&gt;\n</code></pre>\n</li>\n<li><p><strong>Lazy load resources:</strong></p>\n<pre><code>// Load images on demand\nvar image = await ImageSource.LoadFromUriAsync(uri);\n</code></pre>\n</li>\n<li><p><strong>Minimize XAML complexity:</strong></p>\n<ul>\n<li>Avoid deep nesting</li>\n<li>Use compiled bindings (<code>x:Bind</code> where supported)</li>\n<li>Consider Skia-specific optimizations</li>\n</ul>\n</li>\n<li><p><strong>WebAssembly specific:</strong></p>\n<ul>\n<li>Minimize interop calls</li>\n<li>Use <code>InvokeAsync</code> for JS interop</li>\n<li>Consider AOT compilation for performance</li>\n</ul>\n</li>\n</ol>\n<h2>Uno Extensions</h2>\n<pre><code>// Use Uno.Extensions for enhanced patterns\nvar builder = this.CreateBuilder(args)\n    .Configure(host =&gt; host\n        .UseConfiguration()\n        .UseLocalization()\n        .UseNavigation()\n        .UseMvux()\n        .ConfigureServices(services =&gt;\n        {\n            services.AddSingleton&lt;ITodoService, TodoService&gt;();\n        }));\n</code></pre>\n<h2>Deliver</h2>\n<ul>\n<li>single codebase running on web, mobile, and desktop</li>\n<li>consistent UI/UX across all platforms</li>\n<li>platform-specific optimizations where needed</li>\n<li>MVVM or MVUX patterns for testability</li>\n</ul>\n<h2>Validate</h2>\n<ul>\n<li>app builds and runs on all target platforms</li>\n<li>platform-specific features work correctly</li>\n<li>performance is acceptable on WebAssembly</li>\n<li>Hot Reload works during development</li>\n<li>no WPF/UWP-only APIs are used without fallbacks</li>\n</ul>\n","files":[{"path":"references/patterns.md","sizeBytes":10713,"isText":true},{"path":"SKILL.md","sizeBytes":7582,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-27T21:03:28.203507Z","sha256":"D67ABD8AC6D7A08025C2FE614B51985D15A0487DEC5200FF350357466D5205C9","sizeBytes":5982},"review":null,"source":{"repositoryUrl":"https://github.com/Postpartum-genushyacinthus29/dotnet-skills","path":"skills/dotnet-uno-platform","license":"MIT","commit":"25d4b895f3626f4dddacd1527d170de07c634fd5","subtreeSha":"D705B5FE4DF94CBAE712E5A8A93B8FF82A69B4233CF53E08EC4933E4AD3CA548","lastSyncedAt":"2026-11-11T21:45:48.771378Z"},"reviewedAt":"2026-09-27T21:14:06.79299Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/Postpartum-genushyacinthus29/dotnet-skills/tree/main/skills/dotnet-uno-platform"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install postpartum-genushyacinthus29-dotnet-skills@llmmart"},{"target":"git","command":"git clone https://github.com/Postpartum-genushyacinthus29/dotnet-skills.git"}]}