WinUI declares XamlCompositionBrushBase.CompositionBrush as protected; Uno exposed it as public, an unintended Uno-only widening. Reduce it to protected to match the WinUI contract.
All in-repo consumers set it from within XamlCompositionBrushBase subclasses (AcrylicBrush, RadialGradientBrush, RevealBrush, and the sample/test custom brushes), so protected access is sufficient. The backing internal CompositionBrushProperty is unchanged.
No PackageDiffIgnore entry is required: the package-diff gate matches members by name/return/params and treats public and protected as equally visible, so a public->protected reduction is not flagged.
Part of the 7.0 breaking-changes rollup (#8339).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
GitHub Issue: #8339
PR Type:
💬 Other... Breaking change (API alignment with WinUI)
What changed? 🚀
XamlCompositionBrushBase.CompositionBrushwas exposed aspublicin Uno — an unintended Uno-only widening. WinUI declares it asprotected. This PR reduces it toprotectedto match the WinUI contract (BC17 of the Phase 5 breaking-changes wave).All in-repo consumers already set the property from within
XamlCompositionBrushBasesubclasses (AcrylicBrush,RadialGradientBrush,RevealBrush, and the sample/test custom brushes), soprotectedaccess is sufficient — no callers needed widening. The backinginternal CompositionBrushPropertyis unchanged.Validation:
SamplesApp.Skia.Generic(net10.0 Skia) builds clean (0 warnings / 0 errors), transitively compilingUno.UI,Uno.UI.RuntimeTests, and all consuming samples. NoPackageDiffIgnore.xmlentry is required — the package-diff gate treatspublicandprotectedas equally "visible" (matched by name/return/params), so a public→protected reduction is not flagged.PR Checklist ✅
Screenshots Compare Test Runresults — N/A (no visual change).Breaking change — impact & migration path
XamlCompositionBrushBasesubclass that reads or writesbrush.CompositionBrushwill no longer compile.CompositionBrushis only meaningful to assign from a custom brush'sOnConnected/OnDisconnected. Move such access into a subclass (the WinUI-supported pattern). This aligns with WinUI, where the member has always beenprotected.