Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Cleanup DependencyPropertyValuePrecedences #15684

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Feb 28, 2024

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
Copy link
Member Author

@Youssef1313 Youssef1313 Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the first file to review in the PR.

  1. We were not using TemplatedParent
  2. We were using ExplicitStyle for both explicit and implicit styles.
  3. We were using ImplicitStyle for default styles (as indicated in the deleted remarks section of the doc comment)
  4. We were not using DefaultStyle

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-15684/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-15684/index.html

@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
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-15684/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-15684/index.html

@MartinZikmund
Copy link
Member

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

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-15684/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-15684/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-15684/index.html

@Youssef1313
Copy link
Member Author

Pushing to Uno 6

@@ -345,7 +345,7 @@ void SetDefaultForeground(DependencyProperty foregroundProperty)
{
// Hyperlink doesn't appear to inherit foreground from the parent.
// So, we set this with ImplicitStyle precedence which is a higher precedence than Inheritance.
this.SetValue(foregroundProperty, DefaultTextForegroundBrush, DependencyPropertyValuePrecedences.ImplicitStyle);
this.SetValue(foregroundProperty, DefaultTextForegroundBrush, DependencyPropertyValuePrecedences.DefaultStyle);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The right way to do that is by using this.ForegroundProperty.OverrideMetadata().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carldebilly Do you mean to remove the inherits flag? OverrideMetadata will "combine"/"merge" the flags, so it won't work :(

Unless we introduce another overload OverrideMetadata(bool doNotMergeFlags) or so.

We'll probably need to understand how WinUI does this and do the same.

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
4 participants