Skip to content

refactor(dp)!: Clean up DependencyPropertyValuePrecedences enum - #23685

Merged
MartinZikmund merged 1 commit into
feature/breakingchangesfrom
dev/claude/bc39-precedences
Jul 14, 2026
Merged

MartinZikmund merged 1 commit into
feature/breakingchangesfrom
dev/claude/bc39-precedences

Conversation

@ramezgerges

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #16356

PR Type:

💬 Other — breaking API cleanup (refactoring with public enum surface removal)

What changed? 🚀

Cleans up the public DependencyPropertyValuePrecedences enum, converging it on WinUI's BaseValueSource model and removing legacy/misused members.

Before, the enum carried levels that diverged from WinUI and were used inconsistently:

  • an applied style (implicit or explicit) was stored at ExplicitStyle;
  • the built-in (Generic.xaml) default style misused the otherwise-unused ImplicitStyle level;
  • DefaultStyle was effectively vestigial and sat below Inheritance;
  • TemplatedParent had no readers anywhere.

After, aligned with WinUI's BaseValueSource:

Removed / renamed Now
ExplicitStyle Style — an applied implicit or explicit style (WinUI BaseValueSourceStyle)
DefaultStyle BuiltInStyle — the Generic.xaml default style (WinUI BaseValueSourceBuiltInStyle), reordered above Inheritance to reflect its real runtime precedence
ImplicitStyle removed — default-style storage now uses the correctly-named BuiltInStyle
TemplatedParent removed — no readers; the separate templated-parent mechanism is tracked independently

All readers across the DP value-resolution system are repointed onto the surviving values: DependencyObjectStore, DependencyPropertyHelper, Style, FrameworkElement, DependencyObjectExtensions, plus the WrapPanel/Slider call sites. There is no behavioural change for real scenarios — default styles already took precedence over inheritance at runtime (via the misused ImplicitStyle slot); this PR simply makes the enum say what the system actually does, and gives the levels their WinUI-aligned names.

PR Checklist ✅

  • 🧪 Added unit tests exercising each surviving precedence level and the BuiltInStyle-over-Inheritance ordering (Given_DependencyProperty.When_Each_Precedence_Set_Then_Highest_Wins, When_BuiltInStyle_Set_Then_Takes_Precedence_Over_Inherited_Value); existing style/precedence and binder tests updated for the new names.
  • 📚 Docs — n/a (internal precedence semantics, no public documentation surface).
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional).

Breaking change

Source-breaking, intentionally scoped to the 7.0 breaking-changes window (this PR targets feature/breakingchanges).

The public enum members DependencyPropertyValuePrecedences.TemplatedParent, .ImplicitStyle, .ExplicitStyle and .DefaultStyle are removed (hard removal — no [EditorBrowsable]-hidden aliases). Migration for any code referencing them:

  • ExplicitStyle → Style
  • ImplicitStyle / DefaultStyle → BuiltInStyle
  • TemplatedParent → no replacement (it had no readers)

🤖 Generated with Claude Code

@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Jul 8, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221330 found UI Test snapshots differences: skia-linux-screenshots: 0, skia-windows-screenshots: 77

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

  • skia-windows-screenshots: 77 changed over 2366

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

@MartinZikmund MartinZikmund linked an issue Jul 9, 2026 that may be closed by this pull request
@ramezgerges
ramezgerges force-pushed the dev/claude/bc39-precedences branch from 52ab90b to 1a422bf Compare July 13, 2026 15:01
@github-actions github-actions Bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Jul 13, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 222057 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 84

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Examples.png-dark
    • Examples.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • Gamepad_CurrentReading.png-dark
    • Buttons.png-dark
    • Buttons.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ColorPickerSample.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
  • skia-windows-screenshots: 84 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Gamepad_Enumeration.png-dark
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • Buttons.png-dark
    • Buttons.png
    • ContextRequested.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Focus_FocusVisual_Properties.png-dark
    • Image_AnimatedWebP.png-dark
    • Image_AnimatedWebP.png
    • Image_UseTargetSize.png-dark
    • CompositionPath.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Gamepad_CurrentReading.png-dark
    • Examples.png-dark
    • Examples.png

Removes the obsolete `TemplatedParent` and `ImplicitStyle` members and
renames the surviving style precedences to match WinUI's BaseValueSource
model:

- `ExplicitStyle` -> `Style` (holds an applied implicit or explicit style)
- `DefaultStyle` -> `BuiltInStyle` (the Generic.xaml default style),
  reordered above `Inheritance` to reflect its real runtime precedence

Default-style values previously misused the `ImplicitStyle` slot; they now
use the correctly-named `BuiltInStyle`. All readers across the DP system
(DependencyObjectStore, DependencyPropertyHelper, Style, FrameworkElement,
DependencyObjectExtensions) are repointed onto the surviving values. The
removed public members are declared in build/PackageDiffIgnore.xml so the
API-diff gate accepts the intentional break.

BREAKING CHANGE: the public enum members
DependencyPropertyValuePrecedences.TemplatedParent, .ImplicitStyle,
.ExplicitStyle and .DefaultStyle are removed. Use .Style and .BuiltInStyle.

Relates to #16356

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@ramezgerges
ramezgerges force-pushed the dev/claude/bc39-precedences branch from 1a422bf to 1ba8dd3 Compare July 13, 2026 21:04
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 222128 found UI Test snapshots differences: skia-linux-screenshots: 68, skia-windows-screenshots: 80

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

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • EllipsemaskingEllipseGrid.png
    • Gamepad_CurrentReading.png-dark
    • DropDownButtonPage.png-dark
    • ElementLevelTheme.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • CompositionPath.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Examples.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Gamepad_Enumeration.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • Image_AnimatedWebP.png-dark
    • ColorPickerSample.png
  • skia-windows-screenshots: 80 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Focus_FocusVisual_Properties.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • Gamepad_Enumeration.png-dark
    • Image_UseTargetSize.png-dark
    • Image_UseTargetSize.png
    • Buttons.png-dark
    • Buttons.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DataTransferManager.png
    • DisplayInformation.png-dark
    • ContextRequested.png-dark
    • ImageIconPage.png-dark
    • CalendarView_Theming.png-dark
    • Gamepad_CurrentReading.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Basics Pivot Test.png
    • ElementLevelTheme.png-dark

@mergify

mergify Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@MartinZikmund
MartinZikmund merged commit 004885f into feature/breakingchanges Jul 14, 2026
66 checks passed
@MartinZikmund
MartinZikmund deleted the dev/claude/bc39-precedences branch July 14, 2026 08:55
MartinZikmund added a commit that referenced this pull request Sep 2, 2026
BC39 landed via #23685, but the rollup still showed it unticked
against the abandoned PR #15684, two comments still named removed enum members,
and the migration guide never covered the enum at all — it is public and reachable
through the `DependencyObjectExtensions.GetValue`/`SetValue` precedence overloads.

Ticks the rollup row and repoints it, records what actually changed, adds the
old-to-new table to the migration guide, and fixes the two stale comments. The
Hyperlink one was doubly wrong: `SetCurrentForeground` applies at `Animations`
precedence (matching `CHyperlink::UpdateForegroundColor`), not a style level.

Closes unoplatform/uno-private#2135

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qRGTg54VDxAG7zjuEVdoA
MartinZikmund added a commit that referenced this pull request Sep 10, 2026
BC39 landed via #23685, but the rollup still showed it unticked
against the abandoned PR #15684, two comments still named removed enum members,
and the migration guide never covered the enum at all — it is public and reachable
through the `DependencyObjectExtensions.GetValue`/`SetValue` precedence overloads.

Ticks the rollup row and repoints it, records what actually changed, adds the
old-to-new table to the migration guide, and fixes the two stale comments. The
Hyperlink one was doubly wrong: `SetCurrentForeground` applies at `Animations`
precedence (matching `CHyperlink::UpdateForegroundColor`), not a style level.

Closes unoplatform/uno-private#2135

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qRGTg54VDxAG7zjuEVdoA
MartinZikmund added a commit that referenced this pull request Sep 15, 2026
BC39 landed via #23685, but the rollup still showed it unticked
against the abandoned PR #15684, two comments still named removed enum members,
and the migration guide never covered the enum at all — it is public and reachable
through the `DependencyObjectExtensions.GetValue`/`SetValue` precedence overloads.

Ticks the rollup row and repoints it, records what actually changed, adds the
old-to-new table to the migration guide, and fixes the two stale comments. The
Hyperlink one was doubly wrong: `SetCurrentForeground` applies at `Animations`
precedence (matching `CHyperlink::UpdateForegroundColor`), not a style level.

Closes unoplatform/uno-private#2135

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qRGTg54VDxAG7zjuEVdoA
MartinZikmund added a commit that referenced this pull request Sep 16, 2026
BC39 landed via #23685, but the rollup still showed it unticked
against the abandoned PR #15684, two comments still named removed enum members,
and the migration guide never covered the enum at all — it is public and reachable
through the `DependencyObjectExtensions.GetValue`/`SetValue` precedence overloads.

Ticks the rollup row and repoints it, records what actually changed, adds the
old-to-new table to the migration guide, and fixes the two stale comments. The
Hyperlink one was doubly wrong: `SetCurrentForeground` applies at `Animations`
precedence (matching `CHyperlink::UpdateForegroundColor`), not a style level.

Closes unoplatform/uno-private#2135

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011qRGTg54VDxAG7zjuEVdoA
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DependencyProperties precedences storage is wrong [7.0]

4 participants