Skip to content

[Skills] Update WinUI3 migration skills to add more migration mapping item#47043

Open
moooyo wants to merge 3 commits intomainfrom
yuleng/skills/winui3/2
Open

[Skills] Update WinUI3 migration skills to add more migration mapping item#47043
moooyo wants to merge 3 commits intomainfrom
yuleng/skills/winui3/2

Conversation

@moooyo
Copy link
Copy Markdown
Contributor

@moooyo moooyo commented Apr 16, 2026

Summary of the Pull Request

PR Checklist

  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Yu Leng (from Dev Box) and others added 2 commits April 16, 2026 15:52
…and Uno article mappings

Restructure the skill as a "migration contract" that captures human judgment
once and applies it consistently across every file. Add comprehensive mappings
from the Uno Platform WPF-to-WinUI reference article.

Key additions:
- Migration Contract: 20+ prohibited patterns (architecture, XAML, code-behind, resources)
- Control Replacements table: 19 WPF controls with no 1:1 WinUI mapping
- No-Equivalent Patterns: MultiBinding, Adorners, RoutedUICommand, StateTrigger
- Event Replacements: full Mouse→Pointer + Preview event removal mappings
- Property Replacements: Visibility.Hidden, Focusable, TextWrapping, ContextMenu
- Binding comparison: {Binding} vs {x:Bind} feature table
- Complete Find-and-Replace reference: 22 XAML + 18 code-behind mechanical replacements
- StateTrigger pattern: simpler DataTrigger replacement alongside ControlTemplate approach
- Implicit styles BasedOn warning, XamlControlsResources ordering, Visibility.Hidden detail

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…dance to XAML migration

Address niels9001's PR #46462 review comments by adding:
- WindowEx from WinUIEx as preferred Window replacement with property mapping table
- Page-in-Window architecture pattern for regaining FrameworkElement capabilities
- CommunityToolkit.WinUI callout for WPF replacement controls and helpers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@moooyo moooyo requested a review from a team as a code owner April 16, 2026 08:27
Comment thread .github/skills/wpf-to-winui3-migration/SKILL.md Fixed
Comment thread .github/skills/wpf-to-winui3-migration/references/xaml-migration.md Fixed
@github-actions

This comment has been minimized.

…Control

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

These controls exist in both frameworks with the same name — change `System.Windows.Controls` to `Microsoft.UI.Xaml.Controls`:

`Button`, `TextBox`, `TextBlock`, `ComboBox`, `CheckBox`, `ListBox`, `ListView`, `Image`, `StackPanel`, `Grid`, `Border`, `ScrollViewer`, `ContentControl`, `UserControl`, `Page`, `Frame`, `Slider`, `ProgressBar`, `ToolTip`, `RadioButton`, `ToggleButton`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`Button`, `TextBox`, `TextBlock`, `ComboBox`, `CheckBox`, `ListView`, `Image`, `StackPanel`, `Grid`, `Border`, `ScrollViewer`, `ContentControl`, `UserControl`, `Page`, `Frame`, `Slider`, `ProgressBar`, `ToolTip`, `RadioButton`, `ToggleButton`

We should NOT be using ListBox ever in WinUI (as it's deprecated). Instead, we should be using ListView or ItemsView


| WPF Control | WinUI 3 Replacement | Package / Notes |
|-------------|---------------------|-----------------|
| `DataGrid` | `DataGrid` | `CommunityToolkit.WinUI.UI.Controls` — similar API, not identical |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be using: https://github.com/w-ahmad/WinUI.TableView

The Community Toolkit DataGrid has been deprecated

| `DocumentViewer` | `WebView2` | `Microsoft.Web.WebView2` — render PDFs/XPS |
| `FlowDocument` | `RichTextBlock` | Partial replacement only |
| `RichTextBox` | `RichEditBox` | Rich text editing |
| `WrapPanel` | `WrapPanel` | `CommunityToolkit.WinUI.UI.Controls` |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `WrapPanel` | `WrapPanel` | `CommunityToolkit.WinUI.UI.Controls` |
| `WrapPanel` | `WrapPanel` | `CommunityToolkit.WinUI.Controls` |

| `FlowDocument` | `RichTextBlock` | Partial replacement only |
| `RichTextBox` | `RichEditBox` | Rich text editing |
| `WrapPanel` | `WrapPanel` | `CommunityToolkit.WinUI.UI.Controls` |
| `UniformGrid` | `UniformGrid` | `CommunityToolkit.WinUI.UI.Controls` |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `UniformGrid` | `UniformGrid` | `CommunityToolkit.WinUI.UI.Controls` |
| `UniformGrid` | `UniformGrid` | `CommunityToolkit.WinUI.Controls` |

| `RichTextBox` | `RichEditBox` | Rich text editing |
| `WrapPanel` | `WrapPanel` | `CommunityToolkit.WinUI.UI.Controls` |
| `UniformGrid` | `UniformGrid` | `CommunityToolkit.WinUI.UI.Controls` |
| `DockPanel` | `DockPanel` | `CommunityToolkit.WinUI.UI.Controls` |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `DockPanel` | `DockPanel` | `CommunityToolkit.WinUI.UI.Controls` |
| `DockPanel` | `DockPanel` | `CommunityToolkit.WinUI.Controls` |

| WPF Control | WinUI 3 Replacement | Package / Notes |
|-------------|---------------------|-----------------|
| `DataGrid` | `DataGrid` | `CommunityToolkit.WinUI.UI.Controls` — similar API, not identical |
| `Ribbon` | `CommandBar` or `NavigationView` | No Ribbon in WinUI |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a (partial) replacement in Community Toolkit Labs: https://github.com/CommunityToolkit/Labs-Windows/tree/main/components/Ribbon

Copy link
Copy Markdown
Collaborator

@niels9001 niels9001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add WinUI3 migrate skills to help us complete the migration task

3 participants