Skip to content

Fixes various Accessibility Issues in WPF Gallery Application #714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sample Applications/WPFGallery/Controls/ColorTile.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<Button
x:Name="CopyBrushNameButton"
AutomationProperties.Name="Copy brush name"
AutomationProperties.Name="{Binding ColorBrushName, StringFormat='{}Copy brush name {0} to clipboard', RelativeSource={RelativeSource Mode=TemplatedParent}}"
Grid.RowSpan="4"
Grid.Column="1"
Grid.ColumnSpan="2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" KeyboardNavigation.TabNavigation="Once" KeyboardNavigation.DirectionalNavigation="Cycle">
<RadioButton
AutomationProperties.Name="Standard RadioButton Option 1"
AutomationProperties.Name="Default Radio Option 1"
Content="Option 1"
GroupName="radio_group_one"
IsChecked="True"
GotKeyboardFocus="RadioButton_GotKeyboardFocus"
IsEnabled="{Binding ViewModel.IsRadioButtonEnabled, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:RadioButtonPage}, Mode=OneWay}" />
<RadioButton
AutomationProperties.Name="Standard RadioButton Option 2"
AutomationProperties.Name="Default Radio Option 2"
Content="Option 2"
GroupName="radio_group_one"
GotKeyboardFocus="RadioButton_GotKeyboardFocus"
IsEnabled="{Binding ViewModel.IsRadioButtonEnabled, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:RadioButtonPage}, Mode=OneWay}" />
<RadioButton
AutomationProperties.Name="Standard RadioButton Option 3"
AutomationProperties.Name="Default Radio Option 3"
Content="Option 3"
GroupName="radio_group_one"
GotKeyboardFocus="RadioButton_GotKeyboardFocus"
Expand All @@ -73,20 +73,20 @@
XamlCode="&lt;StackPanel&gt; &#10;&#9;&lt;RadioButton Content=&quot;Option 1&quot; FlowDirection=&quot;RightToLeft&quot; GroupName=&quot;radio_group_one&quot; IsChecked=&quot;True&quot;/&gt; &#10;&#9;&lt;RadioButton Content=&quot;Option 2&quot; FlowDirection=&quot;RightToLeft&quot; GroupName=&quot;radio_group_one&quot; /&gt; &#10;&#9;&lt;RadioButton Content=&quot;Option 3&quot; FlowDirection=&quot;RightToLeft&quot; GroupName=&quot;radio_group_one&quot; /&gt; &#10;&lt;/StackPanel&gt;">
<StackPanel Grid.Column="0" KeyboardNavigation.TabNavigation="Once" KeyboardNavigation.DirectionalNavigation="Cycle">
<RadioButton
AutomationProperties.Name="Left Flow RadioButton Option 1"
AutomationProperties.Name="Left Flow Radio Option 1"
Content="Option 1"
FlowDirection="RightToLeft"
GroupName="radio_group_two"
GotKeyboardFocus="RadioButton_GotKeyboardFocus"
IsChecked="True" />
<RadioButton
AutomationProperties.Name="Left Flow RadioButton Option 2"
AutomationProperties.Name="Left Flow Radio Option 2"
Content="Option 2"
FlowDirection="RightToLeft"
GotKeyboardFocus="RadioButton_GotKeyboardFocus"
GroupName="radio_group_two" />
<RadioButton
AutomationProperties.Name="Left Flow RadioButton Option 3"
AutomationProperties.Name="Left Flow Radio Option 3"
Content="Option 3"
FlowDirection="RightToLeft"
GotKeyboardFocus="RadioButton_GotKeyboardFocus"
Expand Down
41 changes: 22 additions & 19 deletions Sample Applications/WPFGallery/Views/DesignGuidance/IconsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
<Button Grid.Column="1"
Padding="8"
FocusManager.IsFocusScope="True"
Command="ApplicationCommands.Copy"
AutomationProperties.Name="Copy to clipboard"
Command="ApplicationCommands.Copy"
AutomationProperties.Name="{Binding Tag, StringFormat='{}Copy {0} to clipboard', RelativeSource={RelativeSource Mode=TemplatedParent}}"
ToolTipService.ToolTip="Copy to clipboard"
CommandParameter="{TemplateBinding Content}"
CommandTarget="{Binding RelativeSource={RelativeSource AncestorType=Page}}">
Expand Down Expand Up @@ -154,7 +154,8 @@
<UniformGrid Columns="2">
<StackPanel Margin="10,0,0,0">
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" Text="Search Icons by Name" Margin="10,0,0,0"/>
<TextBox Text="{Binding ViewModel.SearchText, UpdateSourceTrigger=PropertyChanged, Delay=500}" Margin="10,0,0,0"/>
<TextBox Text="{Binding ViewModel.SearchText, UpdateSourceTrigger=PropertyChanged, Delay=500}"
AutomationProperties.Name="Search Icons" Margin="10,0,0,0"/>
</StackPanel>

</UniformGrid>
Expand Down Expand Up @@ -186,22 +187,24 @@
</ListView>

</Grid>
<Grid Grid.Column="1" Background="{DynamicResource ButtonBackground}">
<StackPanel Orientation="Vertical" Margin="16">
<TextBlock Text="{Binding ViewModel.SelectedIcon.Name}" Style="{StaticResource SubtitleTextBlockStyle}" VerticalAlignment="Center"/>
<TextBlock Text="{Binding ViewModel.SelectedIcon.Character}" FontFamily="{StaticResource SymbolThemeFontFamily}" FontSize="50" Margin="0,12,0,32" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<TextBlock Text="Icon Name"/>
<ContentControl Style="{StaticResource IconData}" Content="{Binding ViewModel.SelectedIcon.Name}"/>
<TextBlock Text="Unicode point"/>
<ContentControl Style="{StaticResource IconData}" Content="{Binding ViewModel.SelectedIcon.Code}"/>
<TextBlock Text="Text glyph"/>
<ContentControl Style="{StaticResource IconData}" Content="{Binding ViewModel.SelectedIcon.TextGlyph}"/>
<TextBlock Text="Code glyph"/>
<ContentControl Style="{StaticResource IconData}" Content="{Binding ViewModel.SelectedIcon.CodeGlyph}"/>
<TextBlock Text="XAML"/>
<TextBlock x:Name="XAMLCode" Text="{Binding ViewModel.SelectedIcon.TextGlyph, StringFormat='&lt;TextBlock FontFamily=&#x22;{{StaticResource SymbolThemeFontFamily}}&#x22; Text=&#x22;{0}&#x22;/&gt;'}" Visibility="Collapsed"/>
<ContentControl Style="{StaticResource IconData}" Content="{Binding ElementName=XAMLCode, Path=Text}" />
</StackPanel>
<Grid Grid.Column="1" Background="{DynamicResource ButtonBackground}">
<ScrollViewer>
<StackPanel Orientation="Vertical" Margin="16">
<TextBlock Text="{Binding ViewModel.SelectedIcon.Name}" Style="{StaticResource SubtitleTextBlockStyle}" VerticalAlignment="Center"/>
<TextBlock Text="{Binding ViewModel.SelectedIcon.Character}" FontFamily="{StaticResource SymbolThemeFontFamily}" FontSize="50" Margin="0,12,0,32" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<TextBlock Text="Icon Name"/>
<ContentControl Style="{StaticResource IconData}" Content="{Binding ViewModel.SelectedIcon.Name}" Tag="Icon Name"/>
<TextBlock Text="Unicode point"/>
<ContentControl Style="{StaticResource IconData}" Content="{Binding ViewModel.SelectedIcon.Code}" Tag="Unicode Point"/>
<TextBlock Text="Text glyph"/>
<ContentControl Style="{StaticResource IconData}" Content="{Binding ViewModel.SelectedIcon.TextGlyph}" Tag="Text Glyph"/>
<TextBlock Text="Code glyph"/>
<ContentControl Style="{StaticResource IconData}" Content="{Binding ViewModel.SelectedIcon.CodeGlyph}" Tag="Code Glyph"/>
<TextBlock Text="XAML"/>
<TextBlock x:Name="XAMLCode" Text="{Binding ViewModel.SelectedIcon.TextGlyph, StringFormat='&lt;TextBlock FontFamily=&#x22;{{StaticResource SymbolThemeFontFamily}}&#x22; Text=&#x22;{0}&#x22;/&gt;'}" Visibility="Collapsed"/>
<ContentControl Style="{StaticResource IconData}" Content="{Binding ElementName=XAMLCode, Path=Text}" Tag="XAML Code"/>
</StackPanel>
</ScrollViewer>
</Grid>
</Grid>
</Grid>
Expand Down
26 changes: 13 additions & 13 deletions Sample Applications/WPFGallery/Views/Layout/GroupBoxPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,36 @@
HeaderText="A GroupBox"
XamlCode="&lt;GroupBox &#10;
Header=&quot;User Information&quot; &#10;
HorizontalAlignment=&quot;Center&quot; &#10;
HorizontalAlignment=&quot;Left&quot; &#10;
VerticalAlignment=&quot;Center&quot; &#10;
Width=&quot;300&quot;&gt;&#10;
Width=&quot;400&quot;&gt;&#10;
&lt;StackPanel&gt;&#10;
&lt;StackPanel Orientation=&quot;Horizontal&quot;&gt;&#10;
&lt;TextBlock Width=&quot;60&quot; Text=&quot;Name:&quot; /&gt;&#10;
&lt;TextBox Name=&quot;NameTextBox&quot; Width=&quot;200&quot; Margin=&quot;10,0,0,20&quot;/&gt;&#10;
&lt;TextBlock Width=&quot;100&quot; Text=&quot;Name:&quot; /&gt;&#10;
&lt;TextBox Name=&quot;NameTextBox&quot; Width=&quot;280&quot; Margin=&quot;10,0,0,20&quot;/&gt;&#10;
&lt;/StackPanel&gt;&#10;
&lt;StackPanel Orientation=&quot;Horizontal&quot;&gt;&#10;
&lt;TextBlock Width=&quot;60&quot; Text=&quot;Gender:&quot; Margin=&quot;0,10,0,0&quot;/&gt;&#10;
&lt;TextBox Name=&quot;GenderTextBox&quot; Width=&quot;200&quot; Margin=&quot;10,0,0,20&quot;/&gt;&#10;
&lt;TextBlock Width=&quot;100&quot; Text=&quot;Gender:&quot; Margin=&quot;0,10,0,0&quot;/&gt;&#10;
&lt;TextBox Name=&quot;GenderTextBox&quot; Width=&quot;280&quot; Margin=&quot;10,0,0,20&quot;/&gt;&#10;
&lt;/StackPanel&gt;&#10;
&lt;Button Content=&quot;Submit&quot; HorizontalAlignment=&quot;Right&quot; Width=&quot;100&quot; Margin=&quot;0,10,0,0&quot; /&gt;&#10;
&lt;/StackPanel&gt;&#10;&lt;/GroupBox&gt;">
<GroupBox
Header="User Information"
HorizontalAlignment="Center"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Width="300">
Width="400">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Width="60" Text="Name:" />
<TextBox Name="NameTextBox" Width="200" Margin="10,0,0,20"/>
<TextBlock Width="100" Text="Name:" />
<TextBox Name="NameTextBox" Width="280" Margin="10,0,0,20" AutomationProperties.Name="Name Field"/>
</StackPanel>

<StackPanel Orientation="Horizontal">
<TextBlock Width="60" Text="Gender:" Margin="0,10,0,0"/>
<TextBox Name="GenderTextBox" Width="200" Margin="10,0,0,20"/>
<TextBlock Width="100" Text="Gender:" Margin="0,10,0,0"/>
<TextBox Name="GenderTextBox" Width="280" Margin="10,0,0,20" AutomationProperties.Name="Gender Field"/>
</StackPanel>
<Button Content="Submit" HorizontalAlignment="Right" Width="100" Margin="0,10,0,0" />
<Button Content="Submit" HorizontalAlignment="Right" Margin="0,10,0,0" />
</StackPanel>
</GroupBox>
</controls:ControlExample>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</Style>
</StackPanel.Resources>
<TextBlock x:Name="StatusMenuItem" Text="" />
<Menu FontSize="14">
<Menu>
<MenuItem Header="File">
<MenuItem Header="New" />
<MenuItem Header="New window" />
Expand Down
Loading