Repository navigation
feat!: Remove Uno-only implicit conversion operators - #24782
Conversation
|
Claude finished @MartinZikmund's task in 3m 2s —— View job Review complete ✅Verdict: Ship. No inline findings — the removal is mechanical, consistent, and each call-site substitution is behavior-preserving.
Issue count by severity: 0 blocking, 0 minor. What was checked:
Cross-cutting observations (non-blocking):
|
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
dcee2bb to
fcce14d
Compare
|
Claude finished @MartinZikmund's task in 1m 58s —— View job Review complete ✅Verdict: Ship. 1 minor (non-blocking) inline finding — everything else checked out clean.
Issue count by severity: 0 blocking, 1 minor. What was checked directly:
Minor finding (inline): Cross-cutting observations (non-blocking):
|
fcce14d to
e9df53d
Compare
|
Claude finished @MartinZikmund's task in 1m 13s —— View job Review complete ✅Verdict: Ship. No new findings — this pass re-reviewed the full diff against
Issue count by severity: 0 blocking, 0 minor. What changed since the last review pass: the numbering nit flagged in the prior automated review ( What was independently re-verified this pass (not just taken on faith from prior reviews):
Cross-cutting observations (non-blocking, unchanged from prior passes): purely mechanical/subtractive change with lock-step call-site fixups, no new abstractions or layering concerns, Conventional Commits followed correctly ( |
e9df53d to
8d261da
Compare
|
Claude finished @MartinZikmund's task in 2m 16s —— View job Review complete ✅Verdict: Ship, with one worth fixing before merge. 2 findings — 1 medium (policy), 1 minor (docs nit).
Issue count by severity: 0 blocking, 1 medium, 1 minor. New findings this pass (not raised in prior automated reviews):
Re-verified from scratch this pass (confirmed still correct):
Cross-cutting observations (non-blocking): mechanical/subtractive change with lock-step call-site fixups, Conventional Commits followed correctly ( |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The public BindingBase string conversion remains and the migration guide contains a null-unsafe replacement.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Removes Uno-only conversion APIs for WinUI parity and fixes object-typed binding fallback generation.
Changes:
- Removes conversion operators and zero-value sentinel fields.
- Migrates internal callers and tests to explicit construction.
- Adds generator coverage, migration guidance, and package-diff exceptions.
Two issues were identified: an equivalent BindingBase conversion remains, and one migration example is not null-safe.
| File | Description |
|---|---|
src/Uno.UI/UI/Xaml/Thickness.cs |
Removes Thickness.Empty. |
src/Uno.UI/UI/Xaml/Setter.cs |
Explicitly extracts the target path. |
src/Uno.UI/UI/Xaml/Media/Brush.cs |
Removes brush conversions. |
src/Uno.UI/UI/Xaml/GridLength.cs |
Removes grid-length conversions. |
src/Uno.UI/UI/Xaml/FrameworkElement.cs |
Uses default thickness values. |
src/Uno.UI/UI/Xaml/FrameworkElement.crossruntime.cs |
Updates the margin default. |
src/Uno.UI/UI/Xaml/Documents/Block.cs |
Updates metadata defaults. |
src/Uno.UI/UI/Xaml/Data/PropertyPath.cs |
Removes conversion to string. |
src/Uno.UI/UI/Xaml/Data/Binding.cs |
Removes string conversion. |
src/Uno.UI/UI/Xaml/CornerRadius.cs |
Removes sentinel and conversion. |
src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.cs |
Updates padding metadata. |
src/Uno.UI/UI/Xaml/Controls/StackPanel/StackPanel.Properties.cs |
Updates border defaults. |
src/Uno.UI/UI/Xaml/Controls/Slider/Slider.mux.cs |
Updates local initialization. |
src/Uno.UI/UI/Xaml/Controls/RichTextBlock/RichTextBlockOverflow.Properties.cs |
Updates padding metadata. |
src/Uno.UI/UI/Xaml/Controls/RichTextBlock/RichTextBlock.Properties.cs |
Updates padding metadata. |
src/Uno.UI/UI/Xaml/Controls/RelativePanel/RelativePanel.Properties.cs |
Updates panel defaults. |
src/Uno.UI/UI/Xaml/Controls/Page/Page.IBorderInfoProvider.cs |
Updates border defaults. |
src/Uno.UI/UI/Xaml/Controls/ListViewBase/VirtualizingPanelLayout.managed.cs |
Updates padding fallback. |
src/Uno.UI/UI/Xaml/Controls/LayoutPanel/LayoutPanel.Properties.cs |
Updates layout defaults. |
src/Uno.UI/UI/Xaml/Controls/ItemsControl/ItemsPresenter.cs |
Updates padding defaults. |
src/Uno.UI/UI/Xaml/Controls/Icons/IconElement.cs |
Removes symbol conversion. |
src/Uno.UI/UI/Xaml/Controls/Grid/RowDefinition.cs |
Removes string conversion. |
src/Uno.UI/UI/Xaml/Controls/Grid/Grid.Properties.cs |
Updates grid defaults. |
src/Uno.UI/UI/Xaml/Controls/Grid/ColumnDefinition.cs |
Removes string conversion. |
src/Uno.UI/UI/Xaml/Controls/FlipView/FlipView.managed.cs |
Updates margin initialization. |
src/Uno.UI/UI/Xaml/Controls/Control/Control.cs |
Updates thickness metadata. |
src/Uno.UI/UI/Xaml/Controls/ContentPresenter/ContentPresenter.cs |
Updates presenter defaults. |
src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewBaseItemChrome.cs |
Updates radius fallback. |
src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarView.Properties.cs |
Updates calendar metadata. |
src/Uno.UI/UI/Xaml/Controls/Border/Border.cs |
Updates border defaults. |
src/Uno.UI/UI/LayoutHelper.cs |
Replaces the removed sentinel. |
src/Uno.UI/DataBinding/BindingPropertyHelper.FastConvert.cs |
Explicitly constructs symbol icons. |
src/Uno.UI/DataBinding/BindingExpression.cs |
Explicitly extracts binding paths. |
src/Uno.UI/Controls/FauxGradientBorderPresenter.cs |
Updates border defaults. |
src/Uno.UI.UnitTests/Windows_UI_XAML_Controls/GridTests/Given_GridLength.cs |
Uses explicit grid-length parsing. |
src/Uno.UI.UnitTests/DependencyProperty/Given_DependencyProperty.cs |
Updates default-value assertions. |
src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Shapes/When_Shape.cs |
Explicitly constructs brushes. |
src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Given_UIElement.cs |
Explicitly constructs grid length. |
src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Given_FrameworkElement.cs |
Explicitly constructs grid lengths. |
src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Controls/Given_SKCanvasElement.skia.cs |
Explicitly constructs brushes. |
src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Controls/Given_Border.cs |
Explicitly constructs visual values. |
src/Uno.UI.Composition/Composition/BorderVisual.skia.cs |
Replaces radius sentinel checks. |
src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs |
Corrects object fallback typing. |
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Given_Binding.cs |
Adds generator regression coverage. |
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/Out/Binding/WhFaVaLiOnObPr/XCG_MainPage.cs |
Adds the generated snapshot. |
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/Out/Binding/WhFaVaLiOnObPr/XCG_LocalizationResources.cs |
Adds snapshot metadata. |
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/Out/Binding/WhFaVaLiOnObPr/XCG_GlobalStaticResources.cs |
Adds snapshot resources. |
src/SourceGenerators/Uno.UI.SourceGenerators.Internal/Mixins/DependencyPropertyMixinGenerator.cs |
Updates generated defaults. |
doc/articles/migrating-to-uno-7.md |
Documents migration steps. |
build/PackageDiffIgnore.xml |
Records intended API breaks. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
Claude finished @MartinZikmund's task in 2m 46s —— View job Review complete ✅Verdict: Fix-first. 1 confirmed finding — everything else holds up; all nits from earlier automated passes and from Copilot's review are already resolved on this branch.
Issue count by severity: 0 blocking, 1 confirmed (parity gap, the PR's own stated goal), 0 minor. What's fixed since the last pass:
Confirmed finding (inline, on Re-verified from scratch (all still correct):
Cross-cutting observations (non-blocking): mechanical/subtractive change with lock-step call-site fixups, Conventional Commits followed correctly ( |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Migration guidance still recommends an Uno-only API, and the previously identified BindingBase implicit conversion remains unresolved.
Review effort: Balanced
Findings: 1
Open (2)
Resolved since last review (1)
|
|
4b205e8 to
c91f33e
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24782/docs/index.html |
|
The build 237657 found UI Test snapshots differences: Details
|
`{Binding FallbackValue=0}` on an object-typed property resolved the
value's type as `Binding` itself (the member's owner), and only compiled
because of Uno's implicit `string -> Binding` operator. Only use the
owner's type when it is a typed value from property-element syntax.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018yJb4hsnB1zq6DJuqugnNW
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018yJb4hsnB1zq6DJuqugnNW
Prepares removing the Uno-only sentinel fields; WinUI has neither. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018yJb4hsnB1zq6DJuqugnNW
WinUI has none of these, so code relying on them compiled on Uno heads
but not on WinAppSDK. Removed: Brush from Color/string, GridLength from
string/double, IconElement from string, CornerRadius from double,
Binding from string, PropertyPath to string, Row/ColumnDefinition from
string, plus the CornerRadius.None and Thickness.Empty fields.
PropertyPath from string is kept: generated XAML emits it for every
{Binding}. XAML markup is unaffected.
BREAKING CHANGE: construct these values explicitly
(new SolidColorBrush(...), new GridLength(...), default(Thickness), ...).
Refs unoplatform/uno-private#2105
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018yJb4hsnB1zq6DJuqugnNW
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018yJb4hsnB1zq6DJuqugnNW
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G7PsEU6gSpLZXrYuK8WWpt
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CKYPsdeNEWd1CARAojRx7H
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CKYPsdeNEWd1CARAojRx7H
The snapshot predated generating BindingOperations.SetBinding. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CKYPsdeNEWd1CARAojRx7H
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CKYPsdeNEWd1CARAojRx7H
Same Uno-only shortcut as Binding's: SetBinding(dp, "Path") compiled on Uno but not on WinAppSDK. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CKYPsdeNEWd1CARAojRx7H
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CKYPsdeNEWd1CARAojRx7H
Thickness.cs and CornerRadius.cs are also compiled into Uno.UI.Composition, so the removed sentinel fields and the CornerRadius from double operator vanish there too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011jrRt9mLQkJpfv6uqds4Xx
It fails on master with the same 318 vs 760 baseline on the Android CI emulator, unrelated to this change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011jrRt9mLQkJpfv6uqds4Xx
It fails on master on the iOS CI simulator, even when retried alone, unrelated to this change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011jrRt9mLQkJpfv6uqds4Xx
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Rqi8XzRAwELp4Fbw4HaA5v
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Rqi8XzRAwELp4Fbw4HaA5v
c824721 to
cdc7fc1
Compare
|
Claude finished @MartinZikmund's task in 15s —— View job Review of the latest pushes (
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24782/docs/index.html |
|
The build 237833 found UI Test snapshots differences: Details
|


GitHub Issue: closes unoplatform/uno-private#2105
PR Type:
✨ Feature (breaking, 7.0)
What changed? 🚀
Uno exposed a few C# shortcuts that WinUI doesn't have. Code using them compiled on Uno heads but failed on a WinAppSDK head, and the string ones only failed at runtime (
Brush b = "Redd"throws). 7.0 removes them:Brush←Color/stringnew SolidColorBrush(...)GridLength←string/doublenew GridLength(...),GridLength.AutoRowDefinition/ColumnDefinition←stringnew RowDefinition { Height = ... }IconElement←stringnew SymbolIcon(Symbol.X)CornerRadius←doublenew CornerRadius(...)Binding←stringnew Binding { Path = new PropertyPath(...) }string←PropertyPathpath.PathCornerRadius.None,Thickness.Emptydefault(CornerRadius),default(Thickness)Kept on purpose:
PropertyPath←string: generated XAML emitsPath = @"X"for every{Binding X}. The generator-backed string operators (Geometry,ImageSource,Duration/KeyTimefrom string,PointCollection,DoubleCollection, …) are also left alone.Microsoft.WinUI.dll):GridLength.Auto,Duration.Automatic/Forever,Duration/KeyTimefromTimeSpan,RepeatBehavior.Forever,Matrix.Identity.Generator fix found along the way:
{Binding FallbackValue=0}on anobject-typed property resolved the value type asBindingitself and only compiled thanks toBinding←string. That's fixed now. Generated output is byte-identical: all 483 existing generator snapshots are unchanged, and a new snapshot test fails without the fix.Ecosystem check: C# Markup (uno.csharpmarkup) uses none of the removed members, since it generates explicit constructors, so the #2075 sequencing in the issue doesn't apply. Toolkit, Themes, Extensions, Chefs and Templates don't use them either.
Commits:
fix(xaml)generator fix, then 2.test(xaml)its snapshot testrefactorinternalThickness.Empty/CornerRadius.None→default(T)feat!removal, plus call-site migration and PackageDiffIgnore entriesdocsmigration guide section and checklist itemValidation
Uno.UI,SamplesAppdesktop (incl. runtime tests),Uno.UI.UnitTests,Uno.UI.SourceGenerators.Tests— net10.0.When_Gregorian_FixedDate*timezone tests (fail on non-UTC machines, green on CI).PR Checklist ✅
migrating-to-uno-7.md)Screenshots Compare Test Runresults.Breaking change / migration: C# code only, and the compiler flags every use. The fix is the explicit constructor from the table above, which is also what compiles on WinAppSDK. XAML is unaffected.
🤖 Generated with Claude Code
https://claude.ai/code/session_018yJb4hsnB1zq6DJuqugnNW