dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.1k stars 1.17k forks source link

ObservableCollection DataContext in ListViewItem accessibility issue #9804

Open vsfeedback opened 2 months ago

vsfeedback commented 2 months ago

This issue has been moved from a ticket on Developer Community.


Hi When Listview control in WPF binds to observable collection datasource , accessibility read out the type of observable collection type class instead of the listviewitem contents while navigation from keyboard up or down arrow keys.


Original Comments

Feedback Bot on 9/11/2024, 07:11 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Ann Yang [MSFT] on 9/11/2024, 00:03 PM:

Thank you for taking the time to log this issue!
In order to help us better understand this scenario, could you attach a video of the issue you describe using [ScreenToGif] ( https://www.screentogif.com/) or a similar tool? We hope we can learn the actual result and the expect result which you want from the video.
It would be appreciated if you could attach a demonstration project in your video.
We are looking forward to hearing from you soon.
Thanks

Rajat Gupta on 9/11/2024, 06:45 PM:

(private comment, text removed)

Feedback Bot on 9/12/2024, 11:59 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

miloush commented 2 months ago

A repro project would be helpful.

himgoyalmicro commented 2 months ago

You need to explicitly set the AutomationProperties.Name for ListViewItem inside ListView.

<ListView.ItemContainerStyle>
    <Style TargetType="ListViewItem" BasedOn="{StaticResource DefaultListViewItemStyle}">
        <Setter Property="AutomationProperties.Name" Value="{Binding Name, Mode=OneWay}"/>
    </Style>
</ListView.ItemContainerStyle>

Let us know if this resolves your issue.