Skip to content

refactor(controls)!: ContentPresenter.ContentTemplateRoot internal (BC36) - #23748

Merged
Xiaoy312 merged 1 commit into
feature/breakingchangesfrom
dev/xygu/20260713/bc36-contenttemplateroot-internal
Jul 27, 2026
Merged

Xiaoy312 merged 1 commit into
feature/breakingchangesfrom
dev/xygu/20260713/bc36-contenttemplateroot-internal

Conversation

@Xiaoy312

Copy link
Copy Markdown
Contributor

GitHub Issue: #8339

PR Type:

💬 Other... Breaking change (API alignment with WinUI)

What changed? 🚀

Reduces the Uno-only public ContentPresenter.ContentTemplateRoot to internal (BC36 of the Phase 5 breaking-changes wave):

  • Getter public → internal; setter protected → private.
  • WinUI's ContentPresenter exposes no ContentTemplateRoot member. The real WinUI ContentTemplateRoot lives on ContentControl, which is unchanged (it stays public — it is a genuine WinUI API, confirmed by the sync-generator stub).

All in-assembly readers keep working via the internal getter (e.g. HyperlinkButton, which reads contentPresenter.ContentTemplateRoot); InternalsVisibleTo covers the test assemblies. Every set-site is inside ContentPresenter itself, so the setter safely narrows to private.

Validation

  • Compile: SamplesApp.Skia.Generic (net10.0 Skia) builds clean (0 warnings / 0 errors). The private set compiling proves there is no cross-type/subclass set-site.
  • Native Android/iOS heads not built locally — CI validates them; grep confirmed no native/cross-assembly caller of the property.

PackageDiffIgnore.xml (6.5 baseline) gets three entries — the property form in <Properties> and the get_/set_ accessors in <Methods> — since a public→internal reduction removes the member from the compared public surface.

PR Checklist ✅

  • 🧪 Added Runtime tests / UI tests / manual sample — N/A: visibility-only change, no behaviour change.
  • 📚 Docs added/updated — N/A (migration note below).
  • 🖼️ Validated PR Screenshots Compare Test Run results — N/A (no visual change).
  • ❗ Contains NO breaking changes — intentionally left unchecked; this is a breaking change (see below).
  • 👀 Reviewed 2 other open pull requests

Breaking change — impact & migration path

  • Impact (source-breaking): external code that read ContentPresenter.ContentTemplateRoot, or subclasses that set it, no longer compile. (The property on ContentControl — the WinUI API — is unaffected.)
  • Migration: access the template root via ContentControl.ContentTemplateRoot where a ContentControl is available, or via the visual tree (VisualTreeHelper). This matches WinUI, which never exposed ContentTemplateRoot on ContentPresenter.

@github-actions github-actions Bot added area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation labels Jul 13, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 222146 found UI Test snapshots differences: skia-linux-screenshots: 68, skia-windows-screenshots: 77

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ElementLevelTheme.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Gamepad_CurrentReading.png-dark
    • DisplayInformation.png-dark
    • EllipsemaskingEllipseGrid.png
    • DropDownButtonPage.png-dark
    • CompositionPath.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Buttons.png-dark
    • Buttons.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Gamepad_Enumeration.png-dark
  • skia-windows-screenshots: 77 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DropDownButtonPage.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Image_UseTargetSize.png
    • Basics Pivot Test.png
    • DisplayInformation.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DynamicFont.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • CalendarView_Theming.png-dark
    • Gamepad_Enumeration.png-dark
    • Gamepad_CurrentReading.png-dark
    • Buttons.png-dark
    • Buttons.png

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260713/bc36-contenttemplateroot-internal branch from 265c8ac to fc10621 Compare July 14, 2026 18:27
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 222373 found UI Test snapshots differences: skia-linux-screenshots: 68, skia-windows-screenshots: 72

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DisplayInformation.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • Focus_FocusVisual_Properties.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Image_AnimatedWebP.png-dark
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • Gamepad_Enumeration.png-dark
    • CompositionPath.png
    • ElementLevelTheme.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
  • skia-windows-screenshots: 72 changed over 2368

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

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260713/bc36-contenttemplateroot-internal branch from fc10621 to 1c13164 Compare July 15, 2026 17:17
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 222516 found UI Test snapshots differences: skia-linux-screenshots: 65, skia-windows-screenshots: 86

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DropDownButtonPage.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • ElementLevelTheme.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Image_AnimatedWebP.png-dark
    • Image_AnimatedWebP.png
    • DisplayInformation.png-dark
    • EllipsemaskingEllipseGrid.png
    • Gamepad_CurrentReading.png-dark
    • Buttons.png-dark
    • Buttons.png
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ImageIconPage.png-dark
    • BitmapIcon_Foreground.png
  • skia-windows-screenshots: 86 changed over 2368

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

@unodevops

Copy link
Copy Markdown
Contributor

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

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260713/bc36-contenttemplateroot-internal branch from 1c13164 to fd99d46 Compare July 16, 2026 15:00
@Xiaoy312
Xiaoy312 enabled auto-merge July 16, 2026 15:00
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 222657 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 104

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Examples.png-dark
    • Examples.png
    • Gamepad_Enumeration.png-dark
    • BitmapIcon_Foreground.png
    • EllipsemaskingEllipseGrid.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • ImageBrush_Stretch.png-dark
    • Image_Margin_Large.png-dark
    • ButtonClippingTestsControl.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • Gamepad_CurrentReading.png-dark
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • ElementLevelTheme.png-dark
    • DisplayInformation.png-dark
  • skia-windows-screenshots: 104 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Focus_FocusVisual_Properties.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ImagesInlineInFlipView.png-dark
    • ImagesInlineInFlipView.png
    • Border_With_Off_Centre_ScaleTransform.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Image_UseTargetSize.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Gamepad_CurrentReading.png-dark
    • ImageBrushInList.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

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

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260713/bc36-contenttemplateroot-internal branch from fd99d46 to 19f385a Compare July 22, 2026 14:16
@Xiaoy312 Xiaoy312 added the ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met label Jul 22, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 223580 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 93

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Examples.png-dark
    • Examples.png
    • ClipboardTests.png-dark
    • DisplayInformation.png-dark
    • Gamepad_CurrentReading.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • DynamicFont.png
    • Image_AnimatedWebP.png
    • DoubleImageBrushInList.png
    • Image_Margin_Large.png-dark
    • Buttons.png-dark
    • Buttons.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • ElementLevelTheme.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • BitmapIcon_Foreground.png
    • ImageBrush_Stretch.png-dark
  • skia-windows-screenshots: 93 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ColorPickerSample.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Gamepad_Enumeration.png-dark
    • DisplayInformation.png-dark
    • DynamicFont.png-dark
    • DynamicFont.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Image_UseTargetSize.png-dark
    • Buttons.png-dark
    • CalendarView_Theming.png-dark
    • Buttons.png
    • CalendarView_Theming.png
    • ContextRequested.png-dark
    • Gamepad_CurrentReading.png-dark

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260713/bc36-contenttemplateroot-internal branch 2 times, most recently from 745b9b5 to 19f385a Compare July 27, 2026 19:22
…C36)

Reduce the Uno-only public `ContentPresenter.ContentTemplateRoot` to internal
(getter public->internal, setter protected->private). WinUI's ContentPresenter
exposes no such member — the real WinUI `ContentTemplateRoot` lives on
ContentControl, which is unchanged. All in-assembly readers (e.g.
HyperlinkButton) keep working via the internal getter, and every set-site is
inside ContentPresenter itself.

Registered the getter/setter (and property form) under PackageDiffIgnore
<IgnoreSet baseVersion="6.5">.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260713/bc36-contenttemplateroot-internal branch from 19f385a to 88fa51a Compare July 27, 2026 19:23
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 224354 found UI Test snapshots differences: skia-linux-screenshots: 67, skia-windows-screenshots: 94

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

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Gamepad_Enumeration.png-dark
    • DisplayInformation.png-dark
    • Buttons.png-dark
    • Buttons.png
    • ColorPickerSample.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • Gamepad_CurrentReading.png-dark
    • Image_UseTargetSize.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ElementLevelTheme.png-dark

@Xiaoy312
Xiaoy312 merged commit c052350 into feature/breakingchanges Jul 27, 2026
68 checks passed
@Xiaoy312
Xiaoy312 deleted the dev/xygu/20260713/bc36-contenttemplateroot-internal branch July 27, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation 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.

4 participants