Skip to content

Commit ab744b3

Browse files
Fix screen reader announcing only button name, not associated description in WPF Gallery
Fold the card Description into AutomationProperties.Name for HeaderTile (5 home tiles) and NavigationCardTemplate (overview/category cards) so Narrator announces both the title and its associated descriptive text. Addresses AzDO 3019241. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0cdcc4a commit ab744b3

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

Sample Applications/WPFGallery/Controls/HeaderTile.xaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@
1414
VerticalAlignment="Stretch"
1515
HorizontalContentAlignment="Stretch"
1616
VerticalContentAlignment="Stretch"
17-
AutomationProperties.Name="{Binding Title, RelativeSource={RelativeSource AncestorType=local:HeaderTile}}"
1817
Click="RootButton_Click"
1918
Padding="24">
19+
<AutomationProperties.Name>
20+
<MultiBinding StringFormat="{}{0}. {1}">
21+
<Binding Path="Title" RelativeSource="{RelativeSource AncestorType=local:HeaderTile}" />
22+
<Binding Path="Description" RelativeSource="{RelativeSource AncestorType=local:HeaderTile}" />
23+
</MultiBinding>
24+
</AutomationProperties.Name>
2025
<Button.Resources>
2126
<SolidColorBrush x:Key="ButtonBackground" Color="{DynamicResource AcrylicBackgroundFillColorDefault}" Opacity="0.8" />
2227
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="{DynamicResource AcrylicBackgroundFillColorDefault}" Opacity="0.9" />

Sample Applications/WPFGallery/Resources/Templates.xaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@
1616
Margin="7"
1717
Padding="20,10"
1818
HorizontalContentAlignment="Left"
19-
AutomationProperties.Name="{Binding Title, StringFormat='{}{0}Page'}"
2019
Command="{Binding ViewModel.NavigateCommand, RelativeSource={RelativeSource AncestorType={x:Type Page}}}"
2120
CommandParameter="{Binding PageType}">
21+
<AutomationProperties.Name>
22+
<MultiBinding StringFormat="{}{0}Page. {1}">
23+
<Binding Path="Title" />
24+
<Binding Path="Description" />
25+
</MultiBinding>
26+
</AutomationProperties.Name>
2227
<StackPanel Orientation="Horizontal">
2328
<Image Source="{Binding ImageSource}"
2429
Width="50"

0 commit comments

Comments
 (0)