--- name: winui3-migration-helper description: Assist migration from WPF to WinUI 3 / Windows App SDK with code transformation and compatibility guidance allowed-tools: Read, Write, Edit, Bash, Glob, Grep tags: [winui, wpf, migration, windows-app-sdk, modernization] --- # winui3-migration-helper Assist migration from WPF to WinUI 3 / Windows App SDK. This skill analyzes WPF applications and provides migration paths, code transformations, and compatibility guidance for modernizing to WinUI 3. ## Capabilities - Analyze WPF codebase for migration compatibility - Identify API differences and required changes - Generate WinUI 3 project structure - Transform XAML syntax differences - Migrate code-behind to modern patterns - Handle namespace and type mappings - Configure Windows App SDK dependencies - Generate migration task list with priorities ## Input Schema ```json { "type": "object", "properties": { "projectPath": { "type": "string", "description": "Path to the WPF project" }, "migrationStrategy": { "enum": ["full", "incremental", "analysis-only"], "default": "analysis-only" }, "targetSdk": { "type": "string", "default": "1.5", "description": "Target Windows App SDK version" }, "preserveWpfComponents": { "type": "array", "items": { "type": "string" }, "description": "WPF components to keep via XAML Islands" }, "generateReport": { "type": "boolean", "default": true } }, "required": ["projectPath"] } ``` ## Output Schema ```json { "type": "object", "properties": { "success": { "type": "boolean" }, "compatibility": { "type": "object", "properties": { "score": { "type": "number" }, "blockers": { "type": "array" }, "warnings": { "type": "array" } } }, "migrationTasks": { "type": "array", "items": { "type": "object", "properties": { "category": { "type": "string" }, "task": { "type": "string" }, "effort": { "enum": ["low", "medium", "high"] }, "automated": { "type": "boolean" } } } }, "codeTransformations": { "type": "array", "items": { "type": "object", "properties": { "file": { "type": "string" }, "original": { "type": "string" }, "transformed": { "type": "string" } } } } }, "required": ["success"] } ``` ## Key Differences ### Namespace Changes | 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` | ### XAML Namespace ```xml ``` ### Window Creation ```csharp // WPF public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } } // WinUI 3 public sealed partial class MainWindow : Window { public MainWindow() { this.InitializeComponent(); // WinUI 3: No automatic window sizing this.SetWindowSize(800, 600); } private void SetWindowSize(int width, int height) { var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this); var windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hWnd); var appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId); appWindow.Resize(new Windows.Graphics.SizeInt32(width, height)); } } ``` ### Common Control Differences ```xml ``` ### Binding Syntax ```xml