winui-wpf-migration

winui-wpf-migration is a skill for Claude Code, Codex from microsoft/win-dev-skills. It costs 100 tokens per session (1,171 once invoked), scanned A, original, MIT.

A migration guide for moving WPF desktop applications to WinUI 3, Microsoft's newer Windows user-interface framework. It maps controls, namespaces, threading, images, and MVVM patterns, where MVVM separates interface code from application logic.

In plain words
What is it for?
Auditing a WPF app, creating its WinUI 3 project, replacing WPF APIs, mapping controls, updating threading and imaging code, and adapting its MVVM implementation.
Why use it?
It turns a broad framework migration into a checklist of code changes and compatibility decisions.

Skill for Claude CodeCodex

Part of the winui plugin — 8 skills, 1 agent shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/microsoft/win-dev-skills/winui-wpf-migration
Any agent
npx skills add microsoft/win-dev-skills --skill winui-wpf-migration
Clone the repo
git clone --depth 1 https://github.com/microsoft/win-dev-skills

Made for: Claude Code, Codex.

Or install winui, the plugin that ships this one along with the rest of its 8 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for winui-wpf-migration

README.md
[![agentmods](https://agentmods.dev/badge/skills/microsoft/win-dev-skills/winui-wpf-migration.svg)](https://agentmods.dev/skills/microsoft/win-dev-skills/winui-wpf-migration)
Your own site
<a href="https://agentmods.dev/skills/microsoft/win-dev-skills/winui-wpf-migration"><img src="https://agentmods.dev/badge/skills/microsoft/win-dev-skills/winui-wpf-migration.svg" alt="Measured on agentmods" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,171 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00100 $0.01171
Opus 5 $0.00050 $0.00585
Sonnet 5 $0.00020 $0.00234
Haiku 4.5 $0.00010 $0.00117

Measured 4d ago against content hash bc7b3bdd2408, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

winui-wpf-migration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/winui/agent-plugin/skills/winui-wpf-migration/SKILL.md · 96 lines

How it starts

The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Migration Process

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, Line

List: 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-defaults

Immediately set <RootNamespace> in .csproj to match the WPF namespace. Update x:Class in App.xaml, MainWindow.xaml and their code-behind files. Build to verify before porting any code.

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.Imaging references at migration start
  • Replace with Windows.Graphics.Imaging (WinRT) or Microsoft.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:

  • INotifyPropertyChanged base → ObservableObject with [ObservableProperty] partial properties
  • Custom RelayCommand[RelayCommand] attribute
  • {Binding}{x:Bind Mode=OneWay}
  • DynamicResource{ThemeResource}
Step 8: Replace Resources
  • .resx.resw (copy + rename to Strings\en-us\)
  • {x:Static}x:Uid for localized strings
  • Properties.Resources.KeyResourceLoader.GetString("Key")

Read the full file on GitHub · 96 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 96 lines · 100 tokens per session scan A bc7b3bdd2408

Subscribe to this mod's changes

winui-wpf-migration is a skill published in the GitHub repository microsoft/win-dev-skills (407 stars, last pushed 2d ago), licensed MIT. It adds 100 tokens to every session and 1,171 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

new

Create a new project to start development quickly.

clacky-ai/openclacky · 10 tokens

gsap-scrolltrigger

Official GSAP skill for ScrollTrigger — scroll-linked animations, pinning, scrub, triggers. Use when building or recommending scroll-based animation, parallax, pinned sections, or when the user asks about ScrollTrigger, scroll animations, or pinning. Recommend GSAP for scroll-driven animation when no library is…

calesthio/OpenMontage · 68 tokens

officecli-word-form

Use this skill to create fillable Word forms (.docx) with real Content Controls (SDT) + legacy FormField checkboxes + MERGEFIELD mail-merge placeholders + document protection. Trigger on: 'fillable form', 'form fields', 'content controls', 'SDT', 'word form', 'fill in', 'only editable fields', 'protect document'…

iOfficeAI/OfficeCLI · 224 tokens

oss-upload

Upload local files to Tencent COS (oss.1024code.com CDN) using coscli. Use when user wants to upload a file to CDN/OSS, or deploy static assets.

clacky-ai/openclacky · 40 tokens

lyria

Generate and validate music with Google Lyria 3 through the Gemini Interactions API. Use before calling OpenMontage googlemusic, designing Lyria 3 Clip or Pro prompts, using image-to-music or custom lyrics, choosing between Lyria 3 and Lyria RealTime, diagnosing Google music-generation failures, or preparing…

calesthio/OpenMontage · 76 tokens

dashscope

DashScope (Alibaba Cloud Bailian / 阿里云百炼) integration — image generation (qwen-image-2.0-pro), text-to-speech (qwen3-tts-flash), and ASR with word-level timestamps (qwen3-asr-flash-filetrans). Use when generating images via Qwen-Image, narrating via Qwen-TTS, or transcribing with word-level timestamps via Qwen-ASR.

calesthio/OpenMontage · 93 tokens