-
Notifications
You must be signed in to change notification settings - Fork 750
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
base: master
Are you sure you want to change the base?
fix: Ensure x:Uid is set only when both name and namespace are correct #19148
Conversation
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19148/index.html |
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19148/index.html |
|
@@ -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" |
There was a problem hiding this comment.
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:
uno/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs
Line 5885 in 4dd8184
var localizedObject = FindMember(objectDefinition, "Uid"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Youssef1313 ! Thanks for the feedback. I'm so sorry for not being able to do this earlier.
A test that covers the code path I mentioned may be needed as well.
Do you mean to add a test for the GenerateFile
method? Not sure how to add one for this. Can you give some tips please?
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19148/index.html |
GitHub Issue (If applicable): closes #19069
PR Type
What kind of change does this PR introduce?
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 becausex: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 correctPR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.Other information
Internal Issue (If applicable):