Skip to content

Add accessible name to C# code copy button (fix private Unicode Name)#786

Open
mmanolova-msft wants to merge 1 commit into
microsoft:mainfrom
mmanolova-msft:fix/copy-csharp-button-accessible-name
Open

Add accessible name to C# code copy button (fix private Unicode Name)#786
mmanolova-msft wants to merge 1 commit into
microsoft:mainfrom
mmanolova-msft:fix/copy-csharp-button-accessible-name

Conversation

@mmanolova-msft

@mmanolova-msft mmanolova-msft commented Jun 26, 2026

Copy link
Copy Markdown

Summary

The C# "Source code" copy button in ControlExample had no AutomationProperties.Name. Because the button's content is only a Segoe Fluent icon glyph ( , U+E8C8), WPF derived the button's UI Automation Name from that glyph, which falls in the Unicode Private Use Area (U+E000–U+F8FF). Accessibility Insights / screen readers flag this as a violation of MAS 4.1.2 – Name, Role, Value.

The sibling XAML copy button already sets AutomationProperties.Name="Copy XAML Code"; this change applies the same treatment to the C# copy button.

Change

  • Sample Applications/WPFGallery/Controls/ControlExample.xaml: added AutomationProperties.Name="Copy C# Code" (and a matching Copy to clipboard tooltip) to the C# code copy button.

Repro (before fix)

  1. Run WPF Gallery, open Layout → ResizeGrip (or any page with a C# code sample).
  2. Expand Source code and inspect the second (C#) copy button with Accessibility Insights for Windows.
  3. The Name property is reported in the private Unicode range.

Fixes AzDO DevDiv#3018313.

Microsoft Reviewers: Open in CodeFlow

The C# 'Source code' copy button had no AutomationProperties.Name, so its UI Automation Name was derived from the Segoe icon glyph (U+E8C8), which lies in the Unicode Private Use Area (U+E000-U+F8FF). Screen readers and Accessibility Insights flagged this (MAS 4.1.2). Added AutomationProperties.Name=Copy C# Code and a matching tooltip, mirroring the sibling XAML copy button.

Fixes AzDO DevDiv#3018313

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant