Skip to content

chore: Cleanup DependencyPropertyValuePrecedences - #15684

Closed
Youssef1313 wants to merge 14 commits into
unoplatform:masterfrom
Youssef1313:cleanup-dp-precedences
Closed

Youssef1313 wants to merge 14 commits into
unoplatform:masterfrom
Youssef1313:cleanup-dp-precedences

Conversation

@Youssef1313

@Youssef1313 Youssef1313 commented Feb 28, 2024 •

Copy link
Copy Markdown
Member

Closes #16356

Removes an unused precedence and renames two others to match their actual semantics.

Note: the removal of the unused precedence makes the current precedences count 8, which means the DependencyPropertyDetails.Stack arrays will now be of length 8 instead of 16 :)

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Feb 28, 2024
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Feb 29, 2024
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@MartinZikmund

Copy link
Copy Markdown
Member

Let's let @jeromelaban to confirm, but it seems safe

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@Youssef1313

Copy link
Copy Markdown
Member Author

Pushing to Uno 6

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days.

@github-actions github-actions Bot added the stale This item has been marked as stale and will be closed if there is no activity. label Jan 31, 2025
@Youssef1313

Copy link
Copy Markdown
Member Author

Definitely still needed

@unodevops

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot removed the stale This item has been marked as stale and will be closed if there is no activity. label Feb 1, 2025
@github-actions

github-actions Bot commented Apr 4, 2025

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days.

@github-actions github-actions Bot added the stale This item has been marked as stale and will be closed if there is no activity. label Apr 4, 2025
@Youssef1313
Youssef1313 marked this pull request as ready for review April 4, 2025 12:06
@Youssef1313
Youssef1313 force-pushed the cleanup-dp-precedences branch from f124395 to ad71431 Compare April 4, 2025 12:11
Youssef1313 and others added 2 commits December 8, 2025 18:59
Removed unused members and updated comments in PackageDiffIgnore.xml.
@MartinZikmund
MartinZikmund force-pushed the cleanup-dp-precedences branch from b4fd659 to 87b18ed Compare December 8, 2025 17:59
@unodevops

Copy link
Copy Markdown
Contributor

Comment thread build/PackageDiffIgnore.xml Resolved
Copilot AI review requested due to automatic review settings January 5, 2026 14:21

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

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/Uno.UI/UI/Xaml/DependencyPropertyValuePrecedences.cs:43

  • The PR description states "makes the current precedences count 8" but the actual count after these changes is 7 precedences: Coercion (0), Animations, Local, ExplicitOrImplicitStyle, DefaultStyle, Inheritance, and DefaultValue. This discrepancy should be corrected in the PR description.
	public enum DependencyPropertyValuePrecedences : int
	{
		/// <summary>
		/// Defined by the value returned by PropertyMetadata.CoerceValueCallback (only if it differs from the input/base value)
		/// </summary>
		Coercion = 0,

		/// <summary>
		/// Defined by animation storyboards
		/// </summary>
		Animations,

		/// <summary>
		/// Values set directly on the Dependency Object
		/// </summary>
		Local,

		/// <summary>
		/// Defined when setting a style from the style property or resolving an implicit style
		/// </summary>
		ExplicitOrImplicitStyle,

		/// <summary>
		/// Values defined by a default style
		/// </summary>
		DefaultStyle,

		/// <summary>
		/// Defined by the inheritance of a FrameworkElement property of the same name
		/// </summary>
		Inheritance,

		/// <summary>
		/// Defined on the dependency property metadata
		/// </summary>
		DefaultValue
	}

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@MartinZikmund

Copy link
Copy Markdown
Member

@Youssef1313 to avoid the public API break, I thought the existing values could be marked as not editor browsable and the renames mapped to the same values, see the latest commit. The only thing that I noticed that could be a problem is that the DefaultStyle and Inheritance were reordered. Is there a specific reason for the swap or is it safe to undo (see my commit)

Copilot AI review requested due to automatic review settings January 5, 2026 15:34
@MartinZikmund
MartinZikmund force-pushed the cleanup-dp-precedences branch from 4f5e736 to 1c42d78 Compare January 5, 2026 15:34

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

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/Uno.UI/UI/Xaml/DependencyPropertyValuePrecedences.cs:56

  • With the current enum value assignments (Inheritance = 6 auto-assigned, DefaultStyle = 7 auto-assigned), DefaultStyle will have a LOWER precedence than Inheritance because the precedence system uses numeric comparison where lower values indicate higher precedence. However, the comment in FrameworkElement.cs (line 738-739) states that DefaultStyle should take precedence OVER inherited property values. This is inconsistent. To fix this, DefaultStyle should be assigned a lower numeric value than Inheritance. Consider: ExplicitOrImplicitStyle = 3, Inheritance = 4, DefaultStyle = 5, DefaultValue = 6.
		/// <summary>
		/// Defined by the inheritance of a FrameworkElement property of the same name
		/// </summary>
		Inheritance,

		/// <summary>
		/// Values defined by a default style
		/// </summary>
		DefaultStyle,

		/// <summary>
		/// Defined on the dependency property metadata
		/// </summary>
		DefaultValue

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

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

@Youssef1313

Youssef1313 commented Jan 8, 2026 •

Copy link
Copy Markdown
Member Author

@MartinZikmund I got it almost green back for you in #22291. Might be easier to continue there.

@MartinZikmund

Copy link
Copy Markdown
Member

I think the potential issue @jeromelaban mentioned still holds - existing code using the enum will now use incorrect values, which could be a problem (my guess is it appears especially in XAML source generator outputs). Not sure how much of a break this could be 🤔

@Youssef1313

Copy link
Copy Markdown
Member Author

@MartinZikmund The values are not used by XAML generator at all. The only impact I can think of is users explicitly using the enum. It's a case where the enum should have been internal, is not intended to be used, and the likelihood of someone using it is low. However, it's still definitely a breaking change, regardless of the "likelihood" of someone hitting it. So up to you if you want to try taking it (and rolling back if issues arise), or if you want to close the PR altogether.

@jeromelaban

Copy link
Copy Markdown
Member

@Youssef1313 the likelyhood of the use of those is still there. We cannot change those for now, even for our internal dependencies.

@Youssef1313
Youssef1313 deleted the cleanup-dp-precedences branch January 14, 2026 13:26
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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]

6 participants