Restore pre-NET8 automation behavior in the ItemsControl
Fixes #8679
Description
Pull request #6862 fixed an issue with grouped ItemsControl not exposing grouped items to the automation, but as a side-effect it broke automation in ItemsControl without grouping. This pull request keeps the fix for grouped ItemsControl and restores the original behavior for non-grouped ItemsControl.
Customer Impact
Automation is broken for non-grouped ItemsControl.
Regression
Yes. This is broken since NET8, in NET7 and NET6 this was working correctly.
Testing
Sample app from #6861 on NET6 was updated with XAML from sample app in #8679 and the custom ItemsControl code was patched with the proposed fix test.zip. Both grouped and ungrouped ItemsControls are working.
Risk
Like the original change that has caused the issue in NET8 automation, even this pull request can have some unforeseen consequences in scenarios not covered by the current test cases.
Microsoft Reviewers: Open in CodeFlow
cc @walterlv
Thank you @jimm98y . And I'm sorry, but I don't believe your current modifications will resolve issue #6861, and may instead reopen the already fixed issue #6861. I believe that including Item in automation is a necessary action.
@jimm98y Could you review the https://github.com/dotnet/wpf/pull/8715 ? I think his modifications can maintain compatibility with the old behaviors while also supporting elements within the Group. Thank you.
Hello, I'm joining this thread to mention this is a critical issue for our test automation. We're awaiting the update.
Hi, Is there any update on this issue?
@Thakur987 Sorry, no. It looks like a solution is being discussed.