winui-wpf-migration
Skill1.4k starsChanged 55 days agoMITView on GitHub
Migrate or port a WPF app to WinUI 3: namespaces (System.Windows to Microsoft.UI.Xaml), control mapping (DataGrid, WrapPanel, TabControl), Dispatcher to DispatcherQueue, imaging, MVVM with CommunityToolkit.Mvvm, ThemeResource. Use when converting WPF code or fixing migration build errors.
1 other project uses a version of this, 1 of them edited.
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Most recently taken up by
- jorgeasaurus/agent-skillsedited, first seen May 11, 2026
Who's talking about microsoft/winappCli
- Stack Overflow“How to launch WinUI3 app from command line”Stack Overflow · May 3, 2026 · 1 votes
- sudosubin/agents.nix“codex-plugins.github.microsoft.winappcli: init at 0.8.0”GitHub · Nov 7, 2026
- sudosubin/agents.nix“agent-plugins.github.microsoft.winappcli: 0.7.1 → 0.8.0”GitHub · Nov 7, 2026
- sudosubin/agents.nix“claude-code-plugins.github.microsoft.winappcli: 0.7.1 → 0.8.0”GitHub · Nov 7, 2026
- sudosubin/agents.nix“copilot-plugins.github.microsoft.winappcli: 0.7.1 → 0.8.0”GitHub · Nov 7, 2026
The biggest 5 of 52 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 52
Talked about on GitHub, Bluesky and Stack Overflow (52 times).
On GitHub · 50
- Nov 7, 2026codex-plugins.github.microsoft.winappcli: init at 0.8.0 — sudosubin/agents.nix0 reactions
- Nov 7, 2026agent-plugins.github.microsoft.winappcli: 0.7.1 → 0.8.0 — sudosubin/agents.nix0 reactions
- Nov 7, 2026claude-code-plugins.github.microsoft.winappcli: 0.7.1 → 0.8.0 — sudosubin/agents.nix0 reactions
- Nov 7, 2026copilot-plugins.github.microsoft.winappcli: 0.7.1 → 0.8.0 — sudosubin/agents.nix0 reactions
- Nov 7, 2026claude-code-marketplaces.github.microsoft.winappcli: 0.7.1 → 0.8.0 — sudosubin/agents.nix0 reactions
45 more on GitHub
- Nov 7, 2026agent-skills.github.microsoft.winappcli: 0.7.1 → 0.8.0 — sudosubin/agents.nix0 reactions
- Nov 7, 2026Bump the windows-app-sdk group with 3 updates — lzvsrx/LZ-AGENT0 reactions
- Nov 7, 2026codex-marketplaces.github.microsoft.winappcli: 0.7.1 → 0.8.0 — sudosubin/agents.nix0 reactions
- Nov 6, 2026Bump the dotnet-dependencies group with 6 updates — rhamenator/SimpleLoanCalculator0 reactions · 1 comment
- Nov 3, 2026UIA fails in Windows Sandbox when ProcessId is 0 — asklar/lvt0 reactions
- Oct 31, 2026Bump the windows-app-sdk group with 3 updates — k25jura/Reeled0 reactions
- Oct 31, 2026Bump the windows-app-sdk group with 3 updates — lzvsrx/LZ-AGENT0 reactions · 1 comment
- Oct 30, 2026Bump the dotnet-dependencies group with 6 updates — rhamenator/SimpleLoanCalculator0 reactions · 2 comments
- Oct 29, 2026codex-marketplaces.github.microsoft.winappcli: init at 0.7.1 — sudosubin/agents.nix0 reactions
- Oct 28, 2026claude-code-plugins.github.microsoft.winappcli: init at 0.7.1 — sudosubin/agents.nix0 reactions
- Oct 28, 2026claude-code-marketplaces.github.microsoft.winappcli: init at 0.7.1 — sudosubin/agents.nix0 reactions
- Oct 21, 2026fix(public RDTE): pin WinApp archive hash offline to survive anonymous GitHub REST limits — SemperSupra/WinInspect0 reactions
- Oct 17, 2026Bump Microsoft.Windows.SDK.BuildTools.WinApp and Microsoft.WindowsAppSDK — k25jura/Reeled0 reactions · 1 comment
- Oct 16, 2026[Feature]: Track sparse packaging workflow support and review follow-ups — microsoft/WinAppVSCE0 reactions
- Oct 16, 2026Bump coverlet.collector and 5 others — rhamenator/SimpleLoanCalculator0 reactions · 2 comments
- Oct 16, 2026chore(deps): update dependency microsoft.windows.sdk.buildtools.winapp to 0.7.1 [automerge] — DevSecNinja/home-assistant-win-companion0 reactions · 1 comment
- Oct 14, 2026agent-skills.github.microsoft.winappcli: init at 0.7.1 — sudosubin/agents.nix0 reactions
- Oct 8, 2026[Candidate] microsoft/winappcli/.github/skills/pr-lifecycle - pr-lifecycle — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 8, 2026[Candidate] microsoft/winappcli/.github/skills/code-quality - code-quality — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 8, 2026Bump Microsoft.Windows.SDK.BuildTools.WinApp from 0.3.2 to 0.7.1 — trsdn/md2loop-windows0 reactions
- Oct 7, 2026Add WinDbg diagnosis plugin — microsoft/win-dev-skills0 reactions · 2 comments
- Oct 7, 2026docs: broaden scope to Windows development and debugging — microsoft/win-dev-skills0 reactions · 1 comment
- Oct 4, 2026copilot-plugins.github.microsoft.winappcli: init at 0.7.1 — sudosubin/agents.nix0 reactions
- Oct 4, 2026Bump Microsoft.Windows.SDK.BuildTools.WinApp from 0.7.0 to 0.7.1 — mirrorpulse/MirrorPulse0 reactions
- Oct 4, 2026agent-plugins.github.microsoft.winappcli: init at 0.7.1 — sudosubin/agents.nix0 reactions
- Oct 3, 2026[Workstream F] PR 5 of 5: An in-session UI Automation helper drives the interactive desktop by element, not coordinates — zaxbysauce/zaxby-hyperv-mcp0 reactions · 8 comments
- Oct 3, 2026Bump the windows-app-sdk group with 2 updates — lzvsrx/LZ-AGENT0 reactions · 2 comments
- Oct 3, 2026chore(deps-node): update dependency @microsoft/winappcli to v0.7.1 — scottlz0310/md-peruse0 reactions
- Oct 2, 2026Bump Microsoft.Windows.SDK.BuildTools.WinApp from 0.6.1 to 0.7.1 — Has-X/Registry0 reactions
- Oct 2, 2026Bump the dotnet-dependencies group with 6 updates — rhamenator/SimpleLoanCalculator0 reactions · 2 comments
- Oct 2, 2026Update dependency Microsoft.Windows.SDK.BuildTools.WinApp to 0.7.1 - autoclosed — mfakane/azunyan0 reactions
- Oct 2, 2026fix(deps): update dependency microsoft.windows.sdk.buildtools.winapp to 0.7.1 — sebdanielsson/varys0 reactions
- Sep 26, 2026Bump the windows-app-sdk group with 2 updates — lzvsrx/LZ-AGENT0 reactions · 1 comment
- Sep 25, 2026Bump Microsoft.Windows.SDK.BuildTools.WinApp from 0.6.1 to 0.7.0 — Has-X/Registry0 reactions · 1 comment
- Sep 25, 2026Bump the dotnet-dependencies group with 6 updates — rhamenator/SimpleLoanCalculator0 reactions · 2 comments
- Sep 24, 2026Bump Microsoft.Windows.SDK.BuildTools.WinApp from 0.3.2 to 0.7.0 — trsdn/md2loop-windows0 reactions · 1 comment
- Sep 18, 2026Bump the dotnet-dependencies group with 6 updates — rhamenator/SimpleLoanCalculator0 reactions · 2 comments
- Sep 12, 2026Bump Microsoft.Windows.SDK.BuildTools.WinApp from 0.5.0 to 0.6.1 — jacob-krarup-madsen/WinForge0 reactions · 1 comment
- Sep 11, 2026Bump the dotnet-dependencies group with 6 updates — rhamenator/SimpleLoanCalculator0 reactions · 2 comments
- Sep 4, 2026UI 驱动三选一:winapp ui、FlaUI、UIAutomationClient — trytoreachpeak0/8005-test-lab0 reactions · 2 comments
- Sep 3, 2026refactor: migrate MSIX packaging/signing to Microsoft's winapp CLI — recregt/winsp0 reactions
- Sep 3, 2026Bump Microsoft.Windows.SDK.BuildTools.WinApp from 0.3.2 to 0.6.1 — trsdn/md2loop-windows0 reactions · 1 comment
- Sep 1, 2026Bump Microsoft.Windows.SDK.BuildTools.WinApp from 0.6.0 to 0.6.1 — onlytrisdev/chrome-native-adblock0 reactions
- Aug 14, 2026Bump Microsoft.Windows.SDK.BuildTools.WinApp from 0.3.1 to 0.6.0 — Has-X/Registry0 reactions · 1 comment
- Jul 2, 2026using winapp cii — peaceshi/Avalonia-NativeAOT-SingleFile0 reactions
On Bluesky · 1
- May 6, 2026Does winappcli help? github.com/microsoft/wi... — @drustheaxe.bsky.social0 likes and reposts · 1 reply
On Stack Overflow · 1
- May 3, 2026How to launch WinUI3 app from command line1 vote
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- jorgeasaurus/agent-skills★ 1479% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- code-qualitySkill
- pr-lifecycleSkill
- pr-reviewSkill
- spec-reviewSkill
- winapp-find-apiSkill
- winapp-find-uiSkill
- winapp-frameworksSkill
- winapp-identitySkill
- winapp-manifestSkill
- winapp-mauiSkill
- winapp-packageSkill
- winapp-performanceSkill
- winapp-sandboxSkill
- winapp-setupSkill
- winapp-signingSkill
- winapp-troubleshootSkill
- winapp-ui-automationSkill
- winui-devtoolsSkill
- winui-code-reviewSkill
- winui-designSkill
- winui-dev-workflowSkill
- winui-packagingSkill
- winui-setupSkill
- winui-ui-testingSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use the WinApp CLI 0.7+ prerequisites and per-app analyzer setup in winui-dev-workflow.
- Distinctive: line 11
Before writing code, inventory WPF-specific APIs:
- Distinctive: line 24
Before implementing API replacements, restore the app project and check its exact references from the WinUI project directory, not the old …
- Very specific: line 30
Use winapp find-ui "<intent>" for usage samples.
- Very specific: line 68
Remove ALL System.Windows.Media.Imaging references at migration start
- Very specific: line 70
Do NOT add <UseWPF>true</UseWPF> — it silently corrupts the build
- Distinctive: line 71
If heavy imaging code exists, migrate it early (step 2, not step 7)
- Very specific: line 74
Delete custom ObservableObject/RelayCommand/DelegateCommand.
- Very specific: line 77
Prefer {x:Bind} for known types.
- Very specific: line 89
Keep packaged as the default.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Migration Process
Use the WinApp CLI 0.7+ prerequisites and per-app analyzer setup in winui-dev-workflow. The normal SDK path needs .NET 8.0.100 or later and the SDK required by the target TFM; Native AOT additionally needs MSVC/Desktop C++ tools. Handle missing prerequisites as described there.
Step 1: Audit the WPF Source
Before writing code, inventory WPF-specific APIs:
# Find all WPF namespace usage
Select-String -Path (Get-ChildItem -Recurse -Filter "*.cs" | Where-Object { $_.FullName -notlike "*\obj\*" }) -Pattern "System\.Windows\." | Select-Object -Property Filename, LineNumber, LineList: WPF controls used, custom MVVM framework, imaging APIs, threading patterns, Win32 interop.
Step 2: Create WinUI 3 Project and Align Namespaces
winapp new --name <AppName> --template winui-mvvm --template-version latest --use-defaultsImmediately set <RootNamespace> in .csproj to match the WPF namespace. Update x:Class in App.xaml, MainWindow.xaml and their code-behind files. Add the analyzer per winui-dev-workflow. Build to verify before porting any code.
Before implementing API replacements, restore the app project and check its exact references from the WinUI project directory, not the old WPF project or machine SDK:
winapp find-api DispatcherQueue --json --project-dir .
winapp find-api members DispatcherQueue --filter TryEnqueue --json --project-dir .
winapp find-api check-property ListView ItemsSource SelectionMode --json --project-dir .Use winapp find-ui "<intent>" for usage samples; see winui-design for project selection and batch API checks.
Step 3: Replace Namespaces
| WPF | WinUI 3 |
System.Windows | Microsoft.UI.Xaml |
System.Windows.Controls | Microsoft.UI.Xaml.Controls |
System.Windows.Media | Microsoft.UI.Xaml.Media |
System.Windows.Input | Microsoft.UI.Xaml.Input |
System.Windows.Data | Microsoft.UI.Xaml.Data |
System.Windows.Threading.Dispatcher | Microsoft.UI.Dispatching.DispatcherQueue |
PresentationCore / PresentationFramework | Remove entirely |
Step 4: Replace Controls
| WPF Control | WinUI 3 Equivalent |
DataGrid | ListView with Grid column headers |
WrapPanel | ItemsRepeater + UniformGridLayout |
TabControl | TabView |
StatusBar | Grid row at bottom with TextBlock elements |
Menu / MenuItem | MenuBar / MenuBarItem / MenuFlyoutItem |
ToolBar | CommandBar |
Expander (custom) | Expander (built-in) |
Step 5: Replace Threading
// WPF
Application.Current.Dispatcher.Invoke(() => { /* UI work */ });
// WinUI 3
dispatcherQueue.TryEnqueue(() => { /* UI work */ });Get via DispatcherQueue.GetForCurrentThread(). No Application.Current.Dispatcher in WinUI 3.
Step 6: Replace Imaging
Critical: PresentationCore.dll and System.Windows.Media.Imaging crash the WinUI XAML compiler. This is an architectural incompatibility — no workaround exists.
- Remove ALL
System.Windows.Media.Imagingreferences at migration start - Replace with
Windows.Graphics.Imaging(WinRT) orMicrosoft.UI.Xaml.Media.Imaging.BitmapImage - Do NOT add
<UseWPF>true</UseWPF>— it silently corrupts the build - If heavy imaging code exists, migrate it early (step 2, not step 7)
Step 7: Replace MVVM Framework
Delete custom ObservableObject/RelayCommand/DelegateCommand. Use CommunityToolkit.Mvvm:
INotifyPropertyChangedbase →ObservableObjectwith[ObservableProperty]partial properties (fix MVVMTK0045; don't keep fields)- Custom
RelayCommand→[RelayCommand]attribute - Prefer
{x:Bind}for known types; keep runtime{Binding}/DisplayMemberPathwhere needed. Seewinui-packaging'sreferences/sourcegen-patterns.mdfor binding modes,x:DataType, and AOT-safe runtime binding. DynamicResource→{ThemeResource}
Step 8: Replace Resources
.resx→.resw(copy + rename toStrings\en-us\){x:Static}→x:Uidfor localized stringsProperties.Resources.Key→ResourceLoader.GetString("Key")
Critical Rules
- ❌ NEVER reference
PresentationCore,PresentationFramework, orSystem.Windows.Controlsassemblies - ❌ NEVER add
<UseWPF>true</UseWPF> - Keep packaged as the default; see
winui-dev-workflowCritical Rules for unpackaged experiments. - ❌ NEVER delete
Package.appxmanifest - ❌ NEVER overwrite
App.xaml/App.xaml.cs— merge WPF code into the WinUI 3 boilerplate - ✅ Launch with project-mode
winapp run, not the .exe directly. - ✅ Break migration into file-level tasks — not one massive rewrite
Post-Migration Validation
# Check for remaining WPF references (should return nothing)
Select-String -Path (Get-ChildItem -Recurse -Filter "*.cs" | Where-Object { $_.FullName -notlike "*\obj\*" }) -Pattern "System\.Windows\."
# Verify packaging preserved
Test-Path "Package.appxmanifest" # should be True
# Build (the analyzer participates when installed)
dotnet build .\MyApp.csproj -p:Platform=x64
# Run the migrated app
winapp run .\MyApp.csproj --detach --jsonFor UI validation, see winui-ui-testing; for crash diagnostics, see winui-dev-workflow. If AOT is intended, also test the published artifact via the workflow's AOT path; the run above is JIT, even in Release.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

