Skip to content

Dev/ramez/bc38 background to control - #23573

Merged
ramezgerges merged 1 commit into
feature/breakingchangesfrom
dev/ramez/bc38-background-to-control
Jul 23, 2026
Merged

ramezgerges merged 1 commit into
feature/breakingchangesfrom
dev/ramez/bc38-background-to-control

Conversation

@ramezgerges

Copy link
Copy Markdown
Contributor

GitHub Issue: closes https://github.com/unoplatform/uno-private/issues/2056

PR Type:

What changed? 🚀

PR Checklist ✅

Copilot AI review requested due to automatic review settings June 26, 2026 17:53
@ramezgerges
ramezgerges changed the base branch from master to feature/breakingchanges June 26, 2026 17:53
@github-actions github-actions Bot added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform 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 area/solution-templates Categorizes an issue or PR as relevant to the solution template area/code-generation Categorizes an issue or PR as relevant to code generation 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 area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk labels Jun 26, 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 aligns Uno’s Background API surface with WinUI by removing the FrameworkElement-level Background and re-declaring it on the WinUI “background painter” types (e.g., Control, Panel, Border, ContentPresenter, ItemsRepeater, ScrollPresenter), with accompanying consumer updates, tests, and spec documentation.

Changes:

  • Removed Background from IFrameworkElement / FrameworkElement interface partials and reintroduced it as independent DPs on the WinUI declarer types (plus related call-site updates).
  • Updated hit-testing and various control/template bindings to use the correct declaring type’s BackgroundProperty.
  • Added/updated unit + runtime tests and updated the BC38 spec and XAML fixtures to reflect WinUI parity (e.g., TextBlock no longer has Background).

Reviewed changes

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

Show a summary per file
File Description
src/Uno.UI/UI/Xaml/Style/Generic/Generic.Native.xaml Removes invalid TextBlock.Background template binding after Background is no longer on FrameworkElement.
src/Uno.UI/UI/Xaml/Shapes/Shape.cs Removes FE-level OnBackgroundChanged override now that Shape no longer exposes Background.
src/Uno.UI/UI/Xaml/IFrameworkElement.cs Removes Background from the internal FE interface surface.
src/Uno.UI/UI/Xaml/FrameworkElement.Interface.skia.cs Removes FE-level Background DP implementation for Skia.
src/Uno.UI/UI/Xaml/FrameworkElement.Interface.reference.cs Removes FE-level Background DP implementation for Reference.
src/Uno.UI/UI/Xaml/FrameworkElement.cs Adjusts legacy hit-test behavior to no longer depend on FE-level Background.
src/Uno.UI/UI/Xaml/Controls/Slider/Slider.mux.cs Updates SliderContainer background assignment to use Panel.BackgroundProperty.
src/Uno.UI/UI/Xaml/Controls/ScrollPresenter/ScrollPresenterPrimitives.idl.cs Drops now-unnecessary new hiding for Background and BackgroundProperty.
src/Uno.UI/UI/Xaml/Controls/ScrollPresenter/ScrollPresenter.cs Removes base.Background = … usage (FE no longer owns Background).
src/Uno.UI/UI/Xaml/Controls/Repeater/ItemsRepeater.Properties.cs Adds ItemsRepeater.Background DP (WinUI declarer parity).
src/Uno.UI/UI/Xaml/Controls/Panel/Panel.cs Adds Panel.Background DP and wires background rendering updates.
src/Uno.UI/UI/Xaml/Controls/Control/Control.cs Adds Control.Background DP (placeholder for templates; no-op change callback).
src/Uno.UI/UI/Xaml/Controls/ContentPresenter/ContentPresenter.cs Adds ContentPresenter.Background DP and keeps background rendering update path.
src/Uno.UI/UI/Xaml/Controls/Border/Border.cs Adds Border.Background DP and keeps background rendering update path.
src/Uno.UI.UnitTests/DependencyProperty/Given_DependencyProperty.BackgroundOwnership.cs Adds DP ownership resolution tests ensuring BackgroundProperty resolves to nearest declaring type.
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_Background.cs Adds runtime rendering tests for Background on painter types + DP independence checks.
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Media/Given_VisualTreeHelper.cs Updates hit-testability logic to check Background on concrete painter types.
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Repeater/Given_ItemsRepeater.cs Updates binding from FrameworkElement.BackgroundProperty to Border.BackgroundProperty.
src/Uno.UI.RuntimeTests/Tests/Microsoft_UI_Xaml_Controls/Given_TreeView.cs Updates template binding to use Control.BackgroundProperty.
src/Uno.UI.Runtime.Skia.Win32/UI/Xaml/Controls/WebView/Win32NativeWebView.cs Updates binding to use ContentPresenter.BackgroundProperty.
src/SourceGenerators/XamlGenerationTests/ThemeResourcesTest.xaml Updates TextBlock usage from Background to Foreground for forward-reference theme resource test.
src/AddIns/Uno.UI.Lottie/LottieVisualSource.Skottie.cs Removes usage of AnimatedVisualPlayer.Background and clears to transparent.
specs/050-breaking-changes-rollup/bc38-background-to-control.md Updates BC38 spec with verified WinUI declarer list, implementation details, and validation notes.

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

Comment thread src/Uno.UI/UI/Xaml/FrameworkElement.cs Resolved
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 219962 did not find any UI Test snapshots differences.

@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Jun 29, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220127 did not find any UI Test snapshots differences.

@ramezgerges
ramezgerges force-pushed the dev/ramez/bc38-background-to-control branch from 1597ba0 to 5959cb5 Compare July 1, 2026 23:10
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220435 did not find any UI Test snapshots differences.

@ramezgerges
ramezgerges force-pushed the dev/ramez/bc38-background-to-control branch from 4868a48 to ea06e6f Compare July 7, 2026 14:42
@unodevops

Copy link
Copy Markdown
Contributor

@ramezgerges
ramezgerges force-pushed the dev/ramez/bc38-background-to-control branch from ea06e6f to 7e9b0b9 Compare July 7, 2026 16:12
@unodevops

Copy link
Copy Markdown
Contributor

@ramezgerges
ramezgerges enabled auto-merge July 7, 2026 17:15
@ramezgerges
ramezgerges force-pushed the dev/ramez/bc38-background-to-control branch from 7e9b0b9 to 15acdc8 Compare July 7, 2026 18:05
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221131 found UI Test snapshots differences: skia-linux-screenshots: 0, skia-windows-screenshots: 79

Details
  • skia-linux-screenshots: 0 changed over 2366

  • skia-windows-screenshots: 79 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • DisplayInformation.png-dark
    • Examples.png
    • ElementLevelTheme.png-dark
    • ExpanderColorValidationPage.png-dark
    • ElementLevelTheme.png
    • ExpanderColorValidationPage.png
    • Focus_FocusVisual_Properties.png-dark
    • Gamepad_Enumeration.png-dark
    • Buttons.png-dark
    • Buttons.png
    • DropDownButtonPage.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ImageIconPage.png-dark
    • ButtonClippingTestsControl.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

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

@ramezgerges
ramezgerges force-pushed the dev/ramez/bc38-background-to-control branch from 15acdc8 to 5cc8de9 Compare July 8, 2026 01:09
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221208 found UI Test snapshots differences: skia-linux-screenshots: 0, skia-windows-screenshots: 80

Details
  • skia-linux-screenshots: 0 changed over 2366

  • skia-windows-screenshots: 80 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DisplayInformation.png-dark
    • ButtonClippingTestsControl.png-dark
    • CalendarView_Theming.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • CalendarView_Theming.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • ImageIconPage.png-dark
    • Buttons.png
    • DropDownButtonPage.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Gamepad_Enumeration.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

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

@ramezgerges
ramezgerges force-pushed the dev/ramez/bc38-background-to-control branch 2 times, most recently from 4ef3043 to 40a4d25 Compare July 8, 2026 15:15
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221302 found UI Test snapshots differences: skia-linux-screenshots: 0, skia-windows-screenshots: 86

Details
  • skia-linux-screenshots: 0 changed over 2366

  • skia-windows-screenshots: 86 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DropDownButtonPage.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • ClipboardTests.png-dark
    • ContentPresenter_NativeEmbedding_ZIndex.png
    • Buttons.png-dark
    • Buttons.png
    • DisplayInformation.png-dark
    • Gamepad_Enumeration.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • ImagesInlineInFlipView.png-dark
    • ImagesInlineInFlipView.png
    • ImageBrushInList.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

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

@ramezgerges
ramezgerges force-pushed the dev/ramez/bc38-background-to-control branch from 40a4d25 to 3d1e74c Compare July 13, 2026 14:59
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 222055 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 79

Details
  • skia-linux-screenshots: 73 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DataTransferManager.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • CompositionPath.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • Gamepad_Enumeration.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Examples.png-dark
    • Examples.png
    • Basics Pivot Test.png
    • Buttons.png-dark
    • Buttons.png
    • Gamepad_CurrentReading.png-dark
    • DisplayInformation.png-dark
  • skia-windows-screenshots: 79 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Gamepad_Enumeration.png-dark
    • Buttons.png
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • Focus_FocusVisual_Properties.png-dark
    • Gamepad_CurrentReading.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • CompositionPath.png
    • DropDownButtonPage.png-dark

@ramezgerges
ramezgerges force-pushed the dev/ramez/bc38-background-to-control branch from 3d1e74c to 3188b7f Compare July 20, 2026 19:11
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 223136 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 91

Details
  • skia-linux-screenshots: 67 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • BitmapIcon_Foreground.png
    • DynamicFont.png
    • ElementLevelTheme.png-dark
    • ButtonClippingTestsControl.png-dark
    • Gamepad_Enumeration.png-dark
    • DataTransferManager.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • EllipsemaskingEllipseGrid.png
    • Buttons.png-dark
    • Buttons.png
    • Image_AnimatedWebP.png
    • ClipboardTests.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DoubleImageBrushInList.png
    • ImageBrush_Stretch.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • DisplayInformation.png-dark
  • skia-windows-screenshots: 91 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Focus_FocusVisual_Properties.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ContentPresenter_NativeEmbedding_ZIndex.png
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • Gamepad_CurrentReading.png-dark
    • Image_AnimatedWebP.png-dark
    • Image_UseTargetSize.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • ColorPickerSample.png-dark

@ramezgerges
ramezgerges force-pushed the dev/ramez/bc38-background-to-control branch from 3188b7f to 28af89b Compare July 21, 2026 13:31
@nventive-devops

Copy link
Copy Markdown
Contributor

The build 223311 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 101

Details
  • skia-linux-screenshots: 67 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DataTransferManager.png
    • EllipsemaskingEllipseGrid.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Examples.png-dark
    • Examples.png
    • Gamepad_CurrentReading.png-dark
    • Image_Margin_Large.png-dark
    • ButtonClippingTestsControl.png-dark
    • ElementLevelTheme.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • DynamicFont.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
  • skia-windows-screenshots: 101 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • ImagesInlineInFlipView.png-dark
    • ImagesInlineInFlipView.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ImageBrushAlignmentXY.png

@unodevops

Copy link
Copy Markdown
Contributor

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

Remove Background/BackgroundProperty (and the FrameworkElement-level
OnBackgroundChanged) from FrameworkElement/IFrameworkElement, and declare it
independently on the WinUI owners: Control, Panel, Border, ContentPresenter,
ItemsRepeater (ScrollPresenter drops its now-pointless `new`). Page and
CalendarViewBaseItem inherit it from Control. Types with no Background in
WinUI (TextBlock, RichTextBlock, Shape+subclasses, Glyphs, Image,
AnimatedVisualPlayer, ...) no longer expose it.

OnBackgroundChanged is Uno-only plumbing (WinUI has none), so it is
private protected on the painters. Consumers reading Background through a
FrameworkElement-typed reference are reconciled (Slider, Lottie, Win32 AOT
WebView). Removed/narrowed public members are whitelisted in the package diff
under both the 6.5 and 6.6 baselines.

BREAKING CHANGE: Background is no longer available on FrameworkElement; it
must be accessed through Control or a painter type, matching WinUI.

Impact spec: specs/050-breaking-changes-rollup/bc38-background-to-control.md
Epic: #8339

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@ramezgerges
ramezgerges force-pushed the dev/ramez/bc38-background-to-control branch from 28af89b to d27d1ff Compare July 22, 2026 18:29
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 223665 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 95

Details
  • skia-linux-screenshots: 67 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • DoubleImageBrushInList.png
    • Image_AnimatedWebP.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DynamicFont.png
    • Image_Margin_Large.png-dark
    • ImageBrush_Stretch.png-dark
    • BitmapIcon_Foreground.png
    • Buttons.png-dark
    • Buttons.png
    • DataTransferManager.png
    • DisplayInformation.png-dark
    • Examples.png-dark
    • Examples.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Gamepad_Enumeration.png-dark
    • EllipsemaskingEllipseGrid.png
    • ElementLevelTheme.png-dark
  • skia-windows-screenshots: 95 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png-dark
    • Buttons.png
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • Gamepad_CurrentReading.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DisplayInformation.png-dark
    • Gamepad_Enumeration.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ImageBrushAlignmentXY.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ImageIconPage.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DropDownButtonPage.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

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

@ramezgerges
ramezgerges merged commit 08d00e8 into feature/breakingchanges Jul 23, 2026
68 checks passed
@ramezgerges
ramezgerges deleted the dev/ramez/bc38-background-to-control branch July 23, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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 area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/solution-templates Categorizes an issue or PR as relevant to the solution template 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants