Skip to content

fix(controls): Fix card automation peers#1675

Open
Nuklon wants to merge 3 commits intolepoco:mainfrom
Nuklon:patch-24
Open

fix(controls): Fix card automation peers#1675
Nuklon wants to merge 3 commits intolepoco:mainfrom
Nuklon:patch-24

Conversation

@Nuklon
Copy link
Copy Markdown
Collaborator

@Nuklon Nuklon commented Mar 17, 2026

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

Unable to cast object of type 'Wpf.Ui.Controls.CardActionAutomationPeer' to type 'System.Windows.Automation.Provider.IItemContainerProvider'.

What is the new behavior?

Similar to my previous PR (#1646), the existing automation peers are not working correctly. The logic was flawed. For CardActionAutomationPeer, we can base it on ButtonAutomationPeer. For CardControlAutomationPeer, use FrameAutomationPeer as this control doesn't have actions on its own.

Nuklon added 3 commits March 17, 2026 16:29
Use the correct automation peer
Refactor CardActionAutomationPeer to implement IInvokeProvider and handle invoke pattern.
@Nuklon Nuklon requested a review from pomianowski as a code owner March 17, 2026 15:34
@github-actions github-actions bot added controls Changes to the appearance or logic of custom controls. PR Pull request dotnet release labels Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controls Changes to the appearance or logic of custom controls. dotnet PR Pull request release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant