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

fix: Ensure x:Uid is set only when both name and namespace are correct #19148

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AndrewKeepCoding
Copy link
Contributor

GitHub Issue (If applicable): closes #19069

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

When a custom attached property with the name Uid is attached to an element, x:Uid might be associated with the target instead. This occurs because x:Uid is linked to an element solely by its name, not by both name and namespace.

What is the new behavior?

x:Uid won't be linked to an element unless both name and namespace are correct

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/code-generation Categorizes an issue or PR as relevant to code generation label Jan 3, 2025
@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19148/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-19148/index.html

@unodevops
Copy link
Contributor

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

@@ -3328,7 +3328,8 @@ private void BuildExtendedProperties(IIndentedStringBuilder outerwriter, XamlObj
{
writer.AppendLineInvariantIndented("// Load {0}", member.Value);
}
else if (member.Member.Name == "Uid")
else if (member.Member.Name == "Uid"
Copy link
Member

Choose a reason for hiding this comment

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

This might need to be fixed as well:

var localizedObject = FindMember(objectDefinition, "Uid");

Copy link
Member

Choose a reason for hiding this comment

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

It should be var localizedObject = FindMember(objectDefinition, "Uid", XamlConstants.XamlXmlNamespace)

A test that covers the code path I mentioned may be needed as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/code-generation Categorizes an issue or PR as relevant to code generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttachedProperty setter is not called in XAML when named Uid
3 participants