Resolve attached properties from the target type - #364
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffe0234ca2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e85cdcca07
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Fixes attached-property resolution in
ChangePropertyActionand the sharedPropertyHelper.This resolves both reported manifestations of the same defect:
Gridcould resolve to an unrelated same-named type fromAvaloniaUI.DiagnosticsSupport.GetRegisteredAttachedwas queried with the attached-property owner type instead of the target object type.Root cause
The resolver scanned every loaded assembly and selected the first type whose short name matched the owner segment in
(Owner.Property). Selection depended on assembly load order, so unrelated types namedGridcould win.That resolved owner type was then passed to
AvaloniaPropertyRegistry.GetRegisteredAttached. Avalonia indexes attached properties by the type they can be attached to—the target control type—not by the property owner type. This made the lookup incorrect even when the owner type happened to resolve as intended.Changes
Assembly.GetTypes()fallback.Gridtype to prove assembly load order cannot affect resolution.(Owner.Property)syntax with aGrid.Columnexample.Performance and compatibility
The new path avoids enumerating loaded assemblies and allocating the LINQ pipelines previously used for every attached-property update. Existing regular-property and inherited-property behavior remains covered by the full suite.
Validation
Xaml.Behaviors.Interactivity.UnitTests: 93 passedXaml.Behaviors.Interactions.UnitTests: 91 passed, 2 existing skippedgit diff --check: cleanCloses #342
Closes #343