Skip to content

Commit 44ae0e3

Browse files
authored
Default AutomationProperties.Name to HintAssist.Hint (#3913)
* feat: add hint-text as AutomationProperty to the ComboBox by default so it can be picked up by a screen reader * feat: add hint-text as AutomationProperty to all input-controls by default so it can be picked up by a screen reader
1 parent 8da4640 commit 44ae0e3

7 files changed

+8
-0
lines changed

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.AutoSuggestBox.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<converters:OutlinedStyleActiveBorderMarginCompensationConverter x:Key="OutlinedStyleActiveBorderMarginCompensationConverter" />
2424
<converters:ElevationRadiusConverter x:Key="ElevationRadiusConverter" Multiplier="-1" />
2525
</Style.Resources>
26+
<Setter Property="AutomationProperties.Name" Value="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource Self}}" />
2627
<Setter Property="DropDownBackground" Value="{DynamicResource MaterialDesign.Brush.Card.Background}" />
2728
<Setter Property="DropDownElevation" Value="Dp2" />
2829
<Setter Property="Template">

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ComboBox.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@
884884
</ControlTemplate>
885885

886886
<Style x:Key="MaterialDesignComboBox" TargetType="{x:Type ComboBox}">
887+
<Setter Property="AutomationProperties.Name" Value="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource Self}}" />
887888
<Setter Property="Background" Value="Transparent" />
888889
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.ComboBox.Border}" />
889890
<Setter Property="BorderThickness" Value="0,0,0,1" />

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.DatePicker.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<Style.Resources>
2020
<Style x:Key="NestedTextBoxStyle" TargetType="{x:Type DatePickerTextBox}" BasedOn="{StaticResource MaterialDesignTextBox}" />
2121
</Style.Resources>
22+
<Setter Property="AutomationProperties.Name" Value="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource Self}}" />
2223
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.ForegroundLight}" />
2324
<Setter Property="BorderThickness" Value="0,0,0,1" />
2425
<Setter Property="CalendarStyle" Value="{StaticResource MaterialDesignDatePickerCalendarPortrait}" />

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.NumericUpDown.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
TargetType="{x:Type ButtonBase}"
3434
BasedOn="{StaticResource MaterialDesignNumericUpDownButtonsStyle}" />
3535
</Style.Resources>
36+
<Setter Property="AutomationProperties.Name" Value="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource Self}}" />
3637
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.ForegroundLight}" />
3738
<Setter Property="BorderThickness" Value="0,0,0,1" />
3839
<Setter Property="DecreaseContent" Value="{StaticResource ContentDecrease}" />

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.PasswordBox.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
</Style>
5252
</Style.Resources>
5353
<Setter Property="AllowDrop" Value="true" />
54+
<Setter Property="AutomationProperties.Name" Value="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource Self}}" />
5455
<Setter Property="Background" Value="Transparent" />
5556
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.ForegroundLight}" />
5657
<Setter Property="BorderThickness" Value="0,0,0,1" />
@@ -608,6 +609,7 @@
608609
</Style>
609610
</Style.Resources>
610611
<Setter Property="AllowDrop" Value="true" />
612+
<Setter Property="AutomationProperties.Name" Value="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource Self}}" />
611613
<Setter Property="Background" Value="Transparent" />
612614
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.ForegroundLight}" />
613615
<Setter Property="BorderThickness" Value="0,0,0,1" />

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TextBox.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<converters:ThicknessCloneConverter x:Key="ThicknessCloneConverter" CloneEdges="All" AdditionalOffsetBottom="-1" />
5050
</Style.Resources>
5151

52+
<Setter Property="AutomationProperties.Name" Value="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource Self}}" />
5253
<Setter Property="AllowDrop" Value="true" />
5354
<Setter Property="Background" Value="Transparent" />
5455
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.TextBox.Border}" />

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TimePicker.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<Style.Resources>
1212
<Style x:Key="NestedTextBoxStyle" TargetType="wpf:TimePickerTextBox" BasedOn="{StaticResource MaterialDesignTextBox}" />
1313
</Style.Resources>
14+
<Setter Property="AutomationProperties.Name" Value="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource Self}}" />
1415
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.ForegroundLight}" />
1516
<Setter Property="BorderThickness" Value="0,0,0,1" />
1617
<Setter Property="ClockHostContentControlStyle">

0 commit comments

Comments
 (0)