Skip to content

Fix/platform xaml winui3 migration#5910

Open
qiutongMS wants to merge 2 commits intoMicrosoftDocs:docsfrom
qiutongMS:fix/platform-xaml-winui3-migration
Open

Fix/platform xaml winui3 migration#5910
qiutongMS wants to merge 2 commits intoMicrosoftDocs:docsfrom
qiutongMS:fix/platform-xaml-winui3-migration

Conversation

@qiutongMS
Copy link
Copy Markdown

Update code samples and API references in XAML platform documentation to use WinUI 3 / Windows App SDK patterns instead of UWP.

Changes

events-and-routed-events-overview.md

  • Update C++/WinRT namespaces: Windows::UI::Xaml:: → Microsoft::UI::Xaml::
  • Fix incorrect event handler type: MouseEventHandler → PointerEventHandler
  • Remove duplicate PointerWheelChanged entry in routed events list
  • Replace deprecated controls with WinUI 3 equivalents:
  • MediaElement → MediaPlayerElement
  • WebView → WebView2

xaml-resource-dictionary.md

  • Update C++/WinRT code: Window::Current() → m_window (private field pattern)
  • Update Colors API: Windows::UI::Colors::Green() → Microsoft::UI::Colors::Green()

Why these changes?

These pages are in the Windows App SDK documentation area but contained UWP code patterns that won't compile in WinUI 3 projects.

Qiutong Shen and others added 2 commits April 23, 2026 11:07
- xaml-resource-dictionary.md:
  - Update C++/WinRT code to use Microsoft::UI::Xaml namespace
  - Update C# code to use WinUI 3 window pattern (m_window instead of Window.Current)
  - Replace Windows.UI.Color.FromArgb with Microsoft.UI.Colors.Green

- items-repeater.md:
  - Remove muxc: namespace prefix (WinUI 2 pattern, unnecessary in WinUI 3)
  - Remove ItemsRepeaterScrollHost comments (not needed in WinUI 3)
  - Fix inconsistent variable names (itemsSource -> MyItemsSource, loadingIndicator -> myLoadingIndicator)
  - Update data binding link to WinUI 3 docs
  - Fix image path to use local reference

- events-and-routed-events-overview.md:
  - Update C++/WinRT namespaces to Microsoft::UI::Xaml
  - Fix incorrect MouseEventHandler -> PointerEventHandler
  - Remove duplicate PointerWheelChanged entry
  - Replace MediaElement/WebView with MediaPlayerElement/WebView2

Co-authored-by: Copilot <[email protected]>
This file belongs under ui/controls/, moving it to the correct PR branch.

Co-authored-by: Copilot <[email protected]>
@prmerger-automator
Copy link
Copy Markdown
Contributor

@qiutongMS : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@learn-build-service-prod
Copy link
Copy Markdown
Contributor

Learn Build status updates of commit ead8b03:

✅ Validation status: passed

File Status Preview URL Details
hub/apps/develop/platform/xaml/events-and-routed-events-overview.md ✅Succeeded
hub/apps/develop/platform/xaml/xaml-resource-dictionary.md ✅Succeeded

For more details, please refer to the build report.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants