Add winui-uwp-migration skill#88
Open
niels9001 wants to merge 1 commit into
Open
Conversation
Adds a UWP to WinUI 3 / Windows App SDK migration skill covering namespace replacement, dispatcher/windowing/dialog/picker fixes, GetForCurrentView replacements, MRT Core, DWriteCore, BackgroundTaskBuilder, notifications, control swaps (MediaElement to MediaPlayerElement, etc.), unsupported-feature warnings, and a step-by-step checklist. Content draws from the official Microsoft Learn migration guides under /migrate-to-windows-app-sdk/. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new winui-uwp-migration skill to the winui plugin, providing structured guidance for migrating UWP applications to WinUI 3 / Windows App SDK.
Changes:
- New
SKILL.mddocumenting UWP → WinUI 3 migration (namespaces, dispatcher, windowing, dialogs, pickers, notifications, controls, tests, etc.) - Adds matching
[Unreleased] → Addedentry toCHANGELOG.md
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| plugins/winui/skills/winui-uwp-migration/SKILL.md | New skill content with process steps, mapping tables, critical rules, checklist, and validation script |
| CHANGELOG.md | Unreleased entry describing the new skill |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | UWP | WinUI 3 / WinAppSDK | | ||
| |-----|---------------------| | ||
| | `MediaElement` | `MediaPlayerElement` (Microsoft.UI.Xaml.Controls) | | ||
| | `MediaPlayerElement` (Windows.UI.Xaml) | `MediaPlayerElement` (Microsoft.UI.Xaml.Controls) — namespace change only | |
| |-----|---------------------| | ||
| | `MediaElement` | `MediaPlayerElement` (Microsoft.UI.Xaml.Controls) | | ||
| | `MediaPlayerElement` (Windows.UI.Xaml) | `MediaPlayerElement` (Microsoft.UI.Xaml.Controls) — namespace change only | | ||
| | `MapControl` (Windows.UI.Xaml.Controls.Maps) | `MapControl` (Microsoft.UI.Xaml.Controls) — WinAppSDK 1.5+ | |
|
|
||
| ### Step 16: Project File Updates | ||
|
|
||
| - Target `net10.0-windows10.0.22621.0` (or current WinAppSDK-supported TFM). |
Comment on lines
+141
to
+150
| | UWP API | WinUI 3 API | | ||
| |---------|-------------| | ||
| | `ApplicationView.TryResizeView` | `AppWindow.Resize` | | ||
| | `AppWindow.TryCreateAsync` | `AppWindow.Create` | | ||
| | `AppWindow.TryShowAsync` | `AppWindow.Show` | | ||
| | `AppWindow.TryConsolidateAsync` | `AppWindow.Destroy` | | ||
| | `AppWindow.RequestMoveXxx` | `AppWindow.Move` | | ||
| | `AppWindow.RequestPresentation` | `AppWindow.SetPresenter` | | ||
| | `CoreApplicationViewTitleBar` | `AppWindowTitleBar` | | ||
| | `CoreApplicationView.TitleBar.ExtendViewIntoTitleBar` | `AppWindow.TitleBar.ExtendsContentIntoTitleBar` | |
Comment on lines
+180
to
+190
| `OnLaunched`, `OnActivated`, `OnFileActivated`, etc. on `Application` are replaced by the unified `AppInstance` / `AppLifecycle` activation model. See the [app lifecycle guide](https://learn.microsoft.com/windows/apps/windows-app-sdk/migrate-to-windows-app-sdk/guides/applifecycle). | ||
|
|
||
| ```csharp | ||
| using Microsoft.Windows.AppLifecycle; | ||
|
|
||
| var args = AppInstance.GetCurrent().GetActivatedEventArgs(); | ||
| switch (args.Kind) | ||
| { | ||
| case ExtendedActivationKind.File: /* ... */ break; | ||
| case ExtendedActivationKind.Protocol: /* ... */ break; | ||
| case ExtendedActivationKind.AppNotification: /* toast click */ break; |
| - ❌ NEVER use `MediaElement` — use `MediaPlayerElement`. | ||
| - ❌ NEVER assume `InkCanvas`, gamepad VKs, or `CoreWindow` will compile — they're not supported. | ||
| - ✅ Always cache one `DispatcherQueue` per window; watch for reentrancy in async code that pumps messages. | ||
| - ✅ Always use `winapp run` to launch — never run the `.exe` directly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new
winui-uwp-migrationskill to thewinuiplugin, covering migration from UWP to WinUI 3 / Windows App SDK.The skill is modeled after the existing
winui-wpf-migrationskill (same structure: process steps, critical rules, checklist, post-migration validation) and pulls content from the official Microsoft Learn migration documentation under/migrate-to-windows-app-sdk/.What's covered
CoreWindow,InkCanvas, gamepad VKs, single-app kiosk, Xbox/HoloLens), .NET Upgrade Assistant, Win32 App IsolationWindows.UI.Xaml.*→Microsoft.UI.Xaml.*ContentDialogwithoutXamlRoot,MessageDialog→ContentDialog,CoreDispatcher→DispatcherQueueWindow.Current/ApplicationView/CoreWindow→AppWindowGetForCurrentView()replacements (window-scoped, not view-scoped)InitializeWithWindow.Initialize(obj, hwnd)AppInstance.GetActivatedEventArgs, single-instancingBackgroundTaskBuilder(WinAppSDK 1.7)AppNotificationManager,PushNotificationManagerMediaElement→MediaPlayerElement,MapControl,CameraCaptureUI,WebAuthenticationBroker→ OAuth,DesktopAcrylicController[UITestMethod]Motivation
UWP-trained suggestions remain a major source of incorrect WinUI 3 code (
MessageDialog,CoreDispatcher,Window.Current,GetForCurrentView, dialogs withoutXamlRoot, pickers without window handles). A dedicated migration skill complementswinui-wpf-migrationso the agent loads the right rules when the source is UWP rather than WPF.Files
plugins/winui/skills/winui-uwp-migration/SKILL.md(new)CHANGELOG.md— entry under[Unreleased] → AddedChecklist
staging(notmain)[Unreleased]entry addedwinui-wpf-migration