Skip to content
github/awesome-copilot

UWP to WinUI 3 App Migration Guide

GitHub CopilotClaude CodeOpenAI CodexCursorDevin / WindsurfGemini CLI

About this skill

A reference for migrating UWP apps to WinUI 3 and the Windows App SDK. It maps legacy UWP APIs to their correct equivalents through before-and-after code comparisons, and covers namespace changes (Windows.UI.Xaml to Microsoft.UI.Xaml), threading (CoreDispatcher to DispatcherQueue), window management (CoreWindow to AppWindow), dialogs, pickers, sharing and printing, background tasks, and unit test migration, along with the most common code generation errors.
Start here

How do you use this skill?

1. Ask the agent to review your UWP code against the migration guide to verify it uses the correct WinUI 3 APIs instead of legacy patterns. 2. Ask to convert all using directives from the Windows.UI.Xaml.* namespaces to Microsoft.UI.Xaml.*. 3. Ask to replace CoreDispatcher.RunAsync with DispatcherQueue.TryEnqueue, and Window.Current with the static App.MainWindow property. 4. Ask to add XamlRoot to every ContentDialog and to initialize pickers via InitializeWithWindow.Initialize with the window handle. 5. Ask to migrate unit tests to the Unit Test App (WinUI in Desktop) project, using [UITestMethod] for XAML tests. Example user request: "Review my UWP project and convert it to WinUI 3, fixing dialogs and popups and migrating background tasks according to the checklist."

Requirements and limitations

Requires an understanding of C#, XAML, the .NET framework, and the Windows App SDK. It relies on the SKILL.md file as a text-only reference and does not execute any code. Technical identifiers such as Microsoft.UI.Xaml, DispatcherQueue, AppWindow, and [UITestMethod] are preserved as-is. The skill does not cover migrating every possible API, and some scenarios (such as CoreDispatcher.ProcessEvents) may require manual code restructuring. It does not guarantee compatibility with all project versions or a safe migration without testing.

Installation by agent

Download and extract the ZIP. It contains the folder winui3-migration-guide and the file SKILL.md with the original attachments and license.

GitHub Copilot
  1. Create this path inside your project if it does not exist:.github/skills/
  2. Copy the entire extracted skill folder to this path:.github/skills/winui3-migration-guide/SKILL.md
  3. Open the project in your agent or refresh the skills list and look for winui3-migration-guide.
  4. Request the task shown above and select the skill. Grant only necessary permissions.
Guide GitHub Copilot official documentation ↗
Claude Code
  1. Create this path inside your project if it does not exist:.claude/skills/
  2. Copy the entire extracted skill folder to this path:.claude/skills/winui3-migration-guide/SKILL.md
  3. Open the project in your agent or refresh the skills list and look for winui3-migration-guide.
  4. Request the task shown above and select the skill. Grant only necessary permissions.
Guide Claude Code official documentation ↗
OpenAI Codex
  1. Create this path inside your project if it does not exist:.agents/skills/
  2. Copy the entire extracted skill folder to this path:.agents/skills/winui3-migration-guide/SKILL.md
  3. Open the project in your agent or refresh the skills list and look for winui3-migration-guide.
  4. Request the task shown above and select the skill. Grant only necessary permissions.
Guide OpenAI Codex official documentation ↗
Cursor
  1. Create this path inside your project if it does not exist:.cursor/skills/
  2. Copy the entire extracted skill folder to this path:.cursor/skills/winui3-migration-guide/SKILL.md
  3. Open the project in your agent or refresh the skills list and look for winui3-migration-guide.
  4. Request the task shown above and select the skill. Grant only necessary permissions.
Guide Cursor official documentation ↗
Devin / Windsurf
  1. Create this path inside your project if it does not exist:.devin/skills/
  2. Copy the entire extracted skill folder to this path:.devin/skills/winui3-migration-guide/SKILL.md
  3. Open the project in your agent or refresh the skills list and look for winui3-migration-guide.
  4. Request the task shown above and select the skill. Grant only necessary permissions.
Guide Devin / Windsurf official documentation ↗
Gemini CLI
  1. Create this path inside your project if it does not exist:.gemini/skills/
  2. Copy the entire extracted skill folder to this path:.gemini/skills/winui3-migration-guide/SKILL.md
  3. Open the project in your agent or refresh the skills list and look for winui3-migration-guide.
  4. Request the task shown above and select the skill. Grant only necessary permissions.
Guide Gemini CLI official documentation ↗

Original files retain their language to preserve tool names and paths. Compatibility is classified by review, not runtime testing on every agent version.