Skip to content

Conversation

@Nuklon
Copy link
Collaborator

@Nuklon Nuklon commented Jan 9, 2026

This used to check ItemContainer, this is wrong, it needs to check SelectionItem and ExpandCollapse as you'll get Unable to cast object of type 'Wpf.Ui.Controls.NavigationViewItemAutomationPeer' to type 'System.Windows.Automation.Provider.IItemContainerProvider'. otherwise.

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.NavigationViewItemAutomationPeer' to type 'System.Windows.Automation.Provider.IItemContainerProvider'.

What is the new behavior?

Working AutomationPeer.

This used to check ItemContainer, this is wrong, it needs to check SelectionItem and ExpandCollapse as you'll get Unable to cast object of type 'Wpf.Ui.Controls.NavigationViewItemAutomationPeer' to type 'System.Windows.Automation.Provider.IItemContainerProvider'. otherwise.
@Nuklon Nuklon requested a review from pomianowski as a code owner January 9, 2026 15:41
@github-actions github-actions bot added controls Changes to the appearance or logic of custom controls. PR Pull request navigation Changes to navigation related controls. dotnet release labels Jan 9, 2026
@pomianowski pomianowski changed the title Fix NavigationViewItemAutomationPeer GetPattern logic fix(controls): NavigationViewItemAutomationPeer GetPattern logic Jan 10, 2026
@pomianowski pomianowski merged commit 8a881e7 into lepoco:main Jan 10, 2026
2 checks passed
@Nuklon Nuklon deleted the patch-39 branch January 10, 2026 15:33
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 navigation Changes to navigation related controls. PR Pull request release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants