BumpyClock/agent-templates / skills/programming
programming
UnverifiedImplement, debug, refactor, or review code with scoped changes and evidence.
references/winui/references/winui-wpf-migration/guide.md
View on GitHub# WPF to WinUI 3
Use this guide to port WPF behavior to WinUI 3 while preserving the application contract.
Choose a migration boundary from the requested scope.
Preserve reusable domain code, valid MVVM abstractions, and supported distribution requirements.
A WinUI port does not inherently require a new MVVM library or conversion of every binding.
## Platform differences
For source probes, API mappings, and binding examples, use [migration examples](references/migration-examples.md).
| WPF feature | WinUI consideration |
| --- | --- |
| `System.Windows.Controls` | Use `Microsoft.UI.Xaml.Controls` equivalents where their behavior fits |
| `Dispatcher.Invoke` | `DispatcherQueue.TryEnqueue` queues work asynchronously and can fail |
| `DataGrid` | Choose a compatible grid or list from required edit, sort, selection, and accessibility behavior |
| `WrapPanel` | Consider `ItemsRepeater` with an appropriate layout |
| `TabControl` | Consider `TabView` and preserve document lifetime behavior |
| `DynamicResource` | Use `ThemeResource` where theme-dependent lookup is required |
| WPF image types | Use WinUI image sources or `Windows.Graphics.Imaging` at the UI boundary |
Capture the UI dispatcher on the owning thread.
Handle a failed enqueue when completion matters.
Do not treat an asynchronous enqueue as equivalent to synchronous `Invoke`.
Keep WPF framework references out of the WinUI XAML project.
Do not enable `UseWPF` as a WinUI compiler workaround.
Separate retained WPF code into a deliberate interop boundary when the migration requires it.
## State and resources
Preserve `Binding` where runtime `DataContext` behavior remains appropriate.
For compiled bindings, account for `x:Bind` source resolution and its `OneTime` default.
Port resource keys and property targets deliberately. A file extension change alone does not migrate localization behavior.
## Completion
Validate the migrated behavior, target architecture, and intended activation path.
Preserve package identity and app data unless the requested migration changes them.
Use [development guidance](../winui-dev-workflow/guide.md) for launch failures and [design guidance](../winui-design/guide.md) for control behavior.
Consult [Microsoft migration guidance](https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/migrate-to-windows-app-sdk/) for API differences.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |