Skip to content

Fix Listview names for the narrator - #796

Merged
Dipesh Kumar (dipeshmsft) merged 1 commit into
microsoft:mainfrom
amarinov-msft:amarinov/listview-narrator-name
Aug 10, 2026
Merged

Fix Listview names for the narrator#796
Dipesh Kumar (dipeshmsft) merged 1 commit into
microsoft:mainfrom
amarinov-msft:amarinov/listview-narrator-name

Conversation

@amarinov-msft

@amarinov-msft Alexander Marinov (amarinov-msft) commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary
Fixes an accessibility issue on the WPF Gallery Collections ListView page. In the first example, the item template renders only the person's Name, but Narrator also announces extra, unnecessary information, including the Company - flagged under MAS 1.3.1 - Info and Relationships and Trap 1.4 - Uncomprehended Element.

Change
Sample Applications/WPFGallery/Views/Collections/ListViewPage.xaml
Added an ItemContainerStyle on the first ListView that sets AutomationProperties.Name="{Binding Name, Mode=OneWay}" on each ListViewItem. An explicit accessible name on the container takes precedence over the  ToString() fallback, so the item's name matches its visible content. Scoped to this example only; the other examples on the page are unchanged.

Result
Under Narrator scan mode, each item in the Basic ListView now announces only the person's name, matching what is displayed on screen. The leaked record fields (including Company) are no longer announced, satisfying MAS 1.3.1. Visual appearance is unchanged.

Testing

  • Built WPFGallery.csproj (0 errors).
  • Verified with a screen reader that the Basic ListView items announce only the Name, with no extra field/company information.

@dipeshmsft

Copy link
Copy Markdown
Member

Alexander Marinov (@amarinov-msft) , given the issue list only the ItemContainer styling change should be sufficient to fix this. The rest of the changes are they for a different issue ?

The Basic ListView item template shows only Name, but the item's
accessible name fell back to the Person record's ToString(), which
dumps every field (including Company). Narrator therefore announced
extra, unnecessary information beyond the visible Name.

Set AutomationProperties.Name to the bound Name via ItemContainerStyle
so the item's accessible name matches the visible content (MAS 1.3.1).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@dipeshmsft Dipesh Kumar (dipeshmsft) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@dipeshmsft
Dipesh Kumar (dipeshmsft) merged commit 428feec into microsoft:main Aug 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants