Repository navigation
WinUI sync - #22377
WinUI sync#22377
Conversation
There was a problem hiding this comment.
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.WinUIproject 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.Extrasdependency from global.json and CI configuration - Makes several existing extension classes
partialto 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 |
There was a problem hiding this comment.
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 ofnameof(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">
d606291 to
9efb56e
Compare
There was a problem hiding this comment.
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.
4889094 to
6dbb5fb
Compare
There was a problem hiding this comment.
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.
36fa099 to
660eb14
Compare
660eb14 to
9d2a7c0
Compare
There was a problem hiding this comment.
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 underHAS_UNO_WINUI, but the file already contains the same signature unconditionally. WhenHAS_UNO_WINUIis defined, this will fail to compile due to a duplicate member. Additionally, the height validation throwsArgumentOutOfRangeException(nameof(width), ...)instead ofnameof(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.
There was a problem hiding this comment.
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_WINUIis defined, this introduces a duplicate constructor signatureRect(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.
There was a problem hiding this comment.
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.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
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.
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22377/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22377/wasm-skia-net9/index.html |
|
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22377/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22377/docs/index.html |
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:
Screenshots Compare Test Runresults.Other information ℹ️