Skip to content

WinUI sync - #22377

Merged
MartinZikmund merged 151 commits into
masterfrom
dev/mazi/winui-sync
Apr 16, 2026
Merged

MartinZikmund merged 151 commits into
masterfrom
dev/mazi/winui-sync

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Jan 16, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: closes #14986

PR Type:

What is the current behavior? 🤔

What is the new behavior? 🚀

PR Checklist ✅

Please check if your PR fulfills the following requirements:

Other information ℹ️

Copilot AI review requested due to automatic review settings January 16, 2026 09:45
@github-actions github-actions Bot added area/build Categorizes an issue or PR as relevant to build infrastructure area/automation Categorizes an issue or PR as relevant to project automation kind/documentation labels Jan 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Uno Platform's WinUI synchronization tooling to generate API stubs from WinUI instead of UWP. The changes introduce a new HAS_UNO_WINUI conditional compilation flag and update the Uno.UWPSyncGenerator tool to work with WinUI assemblies.

Changes:

  • Adds a new Uno.UWPSyncGenerator.Reference.WinUI project to reference WinUI assemblies for API generation
  • Updates the sync generator logic to handle WinUI-specific types, interfaces, and attributes
  • Updates WindowsAppSDK package references to version 1.8.260101001
  • Removes MSBuild.Sdk.Extras dependency from global.json and CI configuration
  • Makes several existing extension classes partial to support WinUI-generated members

Reviewed changes

Copilot reviewed 48 out of 49 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Uno.UWPSyncGenerator/Uno.UWPSyncGenerator.csproj Adds reference to Basic.Reference.Assemblies.Net70 package
src/Uno.UWPSyncGenerator/SyncGenerator.cs Adds ignored attributes for WinUI interop types
src/Uno.UWPSyncGenerator/Program.cs Refactors to use HAS_UNO_WINUI flag and simplifies build calls
src/Uno.UWPSyncGenerator/Helpers/SymbolMatchingHelpers.cs Adds symbol skipping logic and parameter name/RefKind ignoring for WinUI differences
src/Uno.UWPSyncGenerator/Generator.cs Major refactoring to support WinUI assembly generation with namespace filtering and path mapping
src/Uno.UWPSyncGenerator/DocGenerator.cs Updates method signature to support conditional compilation
src/Uno.UWPSyncGenerator.Reference/Uno.UWPSyncGenerator.Reference.csproj Updates WindowsAppSDK version to 1.8.260101001
src/Uno.UWPSyncGenerator.Reference.WinUI/references.txt Adds WinUI assembly reference list (generated file)
src/Uno.UWPSyncGenerator.Reference.WinUI/Uno.UWPSyncGenerator.Reference.WinUI.csproj New project for WinUI reference generation
src/Uno.UWP/System.Runtime/WindowsRuntimeSystemExtensions.cs Makes class partial for WinUI compatibility
src/Uno.UWP/System.Runtime/WindowsRuntimeBufferExtensions.cs Makes class partial for WinUI compatibility
src/Uno.UWP/System.Runtime/AsyncInfo.cs Makes class partial for WinUI compatibility
src/Uno.UWP/System.IO/WindowsRuntimeStreamExtensions.cs Makes class partial for WinUI compatibility
src/Uno.UWP/System.IO/WindowsRuntimeStorageExtensions.cs Makes class partial for WinUI compatibility
src/Uno.UWP/Foundation/GuidHelper.cs Removes BOM character
src/Uno.UI/UI/Xaml/Shapes/Shape.layout.*.cs Removes unused Windows.Phone.Media.Devices import
src/Uno.UI/UI/Xaml/Media/DoubleCollection.cs Adds explicit GetEnumerator for WinUI
src/Uno.UI/UI/Xaml/Media/Animation/TransitionCollection.cs Adds explicit GetEnumerator for WinUI
src/Uno.UI/UI/Xaml/FrameworkElement.Layout.crossruntime.cs Adds pragma directives for CA1305
src/Uno.UI/UI/Xaml/Duration.cs Removes BOM character and extra blank line
src/Uno.UI/UI/Xaml/CornerRadius.cs Removes BOM character
src/Uno.UI/UI/Xaml/Controls/ItemCollection.cs Adds explicit VectorChanged event implementation for WinUI
src/Uno.UI/UI/Xaml/Automation/ElementNotEnabledException.cs Makes class partial
src/Uno.UI/UI/Xaml/Automation/ElementNotAvailableException.cs Makes class partial
src/Uno.UI.Toolkit/Uno.UI.Toolkit.Windows.csproj Changes to Microsoft.NET.Sdk and removes conditional UNO_UWP_BUILD checks
src/Uno.UI.RemoteControl.Host/Config/*.json Removes MSBuild.Sdk.Extras references
src/Uno.UI-Tools.slnf Adds WinUI reference project to solution filter
src/Uno.Foundation/Size.cs Adds float constructor overload for WinUI
src/Uno.Foundation/Rect.cs Adds duplicate float constructor (BUG)
src/Uno.Foundation/Point.cs Adds float constructor overload for WinUI
src/Uno.Foundation/Collections/StringMap.cs Adds explicit MapChanged event for WinUI
src/Uno.Foundation/Collections/PropertySet.cs Adds explicit MapChanged event for WinUI
src/SamplesApp/UITests.Shared/Windows_Phone/Devices_Notifications_VibrationDevice.xaml.cs Adds missing using directive
src/SamplesApp/SamplesApp.Windows/SamplesApp.Windows.csproj Updates WindowsAppSDK version and removes build tools reference
src/AddIns/Uno.UI.MSAL/Uno.UI.MSAL.Windows.csproj Changes to Microsoft.NET.Sdk
global.json Removes MSBuild.Sdk.Extras
build/ci/net10/_global.json Removes MSBuild.Sdk.Extras
build/Uno.UI.Build.csproj Updates target framework to net7.0 and changes reference project
Directory.Build.props Adds HAS_UNO_WINUI define constant

Comment thread src/Uno.UWPSyncGenerator/Generator.cs Resolved
Comment thread Directory.Build.props Resolved
Copilot AI review requested due to automatic review settings January 16, 2026 10:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 49 out of 50 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (3)

src/Uno.Foundation/Rect.cs:60

  • The height validation incorrectly uses nameof(width) instead of nameof(height) in the ArgumentOutOfRangeException. This will produce a misleading error message when a negative height is provided.
	public Rect(float x, float y, float width, float height)
	{
		if (!Uno.FoundationFeatureConfiguration.Rect.AllowNegativeWidthHeight)
		{
			if (width < 0)
			{
				throw new ArgumentOutOfRangeException(nameof(width), _negativeErrorMessage);
			}

			if (height < 0)
			{
				throw new ArgumentOutOfRangeException(nameof(width), _negativeErrorMessage);

src/Uno.UI/UI/Xaml/Shapes/Shape.layout.legacy.cs:1

  • Removed unused using directive.
    src/Uno.UI.Toolkit/Uno.UI.Toolkit.Windows.csproj:1
  • The System.Threading.Tasks.Extensions package reference was removed entirely, but it was previously included only for UWP builds. Since the project now exclusively targets WinUI (as UNO_UWP_BUILD conditions were removed), verify that this package is no longer needed or is provided transitively by the new target framework.
<Project Sdk="Microsoft.NET.Sdk">

Comment thread src/Uno.UWPSyncGenerator/Generator.cs Resolved
Copilot AI review requested due to automatic review settings January 16, 2026 13:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 2796 changed files in this pull request and generated 4 comments.

Comment thread src/Uno.Foundation/Rect.cs Resolved
Comment thread src/Uno.Foundation/Rect.cs Resolved
Comment thread src/Uno.UWPSyncGenerator/Generator.cs Resolved
Comment thread build/Uno.UI.Build.csproj Resolved
Copilot AI review requested due to automatic review settings January 16, 2026 14:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 4104 changed files in this pull request and generated 1 comment.

Comment thread src/Uno.Foundation/Rect.cs Resolved
@MartinZikmund MartinZikmund self-assigned this Jan 16, 2026
Copilot AI review requested due to automatic review settings February 18, 2026 19:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 5523 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Uno.Foundation/Rect.cs Resolved
Comment thread src/Uno.Foundation/Rect.cs Resolved
Comment thread build/Uno.UI.Build.csproj Resolved
Copilot AI review requested due to automatic review settings February 20, 2026 08:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 5536 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Uno.Foundation/Rect.cs Resolved
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/winui-sync branch 2 times, most recently from 36fa099 to 660eb14 Compare February 20, 2026 14:56
Copilot AI review requested due to automatic review settings March 16, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 5518 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/Uno.Foundation/Rect.cs:1

  • This adds a second Rect(float x, float y, float width, float height) constructor under HAS_UNO_WINUI, but the file already contains the same signature unconditionally. When HAS_UNO_WINUI is defined, this will fail to compile due to a duplicate member. Additionally, the height validation throws ArgumentOutOfRangeException(nameof(width), ...) instead of nameof(height). To fix: remove/replace the existing float ctor (or guard it with the inverse condition) so only one signature exists per build, and correct the parameter name in the height exception.
#nullable enable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Directory.Build.props Resolved
Copilot AI review requested due to automatic review settings March 16, 2026 13:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 5526 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

src/Uno.Foundation/Rect.cs:1

  • When HAS_UNO_WINUI is defined, this introduces a duplicate constructor signature Rect(float, float, float, float), which will fail compilation. Consider either (1) removing/replacing the existing float ctor and moving the validation into it, or (2) wrapping the existing ctor in #if !HAS_UNO_WINUI, or (3) changing one overload’s signature and delegating to a single implementation to avoid duplication.
#nullable enable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Uno.UI-Tools.slnf Resolved
Comment thread build/Uno.UI.Build.csproj Resolved
Comment thread Directory.Build.props Resolved
Copilot AI review requested due to automatic review settings March 18, 2026 10:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 5451 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Uno.UI-Tools.slnf Resolved
Comment thread build/Uno.UI.Build.csproj Resolved
Comment thread Directory.Build.props Resolved
Copilot AI review requested due to automatic review settings March 18, 2026 10:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 3887 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 207459 has failed on Uno.UI - CI.

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

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

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/build Categorizes an issue or PR as relevant to build infrastructure area/code-generation Categorizes an issue or PR as relevant to code generation kind/documentation platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sync generator did not generate VectorExtensions class

6 participants