diff options
author | Eric Maupin <ermaup@microsoft.com> | 2019-10-19 01:30:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-19 01:30:00 +0300 |
commit | 194178d1987391461249737f24593294336f150d (patch) | |
tree | 6cbbd51864c4f115d5701e4193042ec288ab7b09 | |
parent | 0ccc20ab4029c5a140293d7fe71cbb36dc4229db (diff) | |
parent | 4524d7b90eaa165c75533fb1132fb669419fe231 (diff) |
Merge pull request #671 from xamarin/ermau-win-a11y-improve
Improve accessibility on Windows
-rw-r--r-- | Xamarin.PropertyEditing.Windows/CollectionEditorWindow.xaml | 29 | ||||
-rw-r--r-- | Xamarin.PropertyEditing.Windows/Themes/Resources.xaml | 13 |
2 files changed, 31 insertions, 11 deletions
diff --git a/Xamarin.PropertyEditing.Windows/CollectionEditorWindow.xaml b/Xamarin.PropertyEditing.Windows/CollectionEditorWindow.xaml index d9fdc41..d0a96d6 100644 --- a/Xamarin.PropertyEditing.Windows/CollectionEditorWindow.xaml +++ b/Xamarin.PropertyEditing.Windows/CollectionEditorWindow.xaml @@ -9,6 +9,13 @@ MinHeight="300" Height="500" MinWidth="500" Width="700" ShowIcon="False" ShowMaximize="False" ShowMinimize="False" WindowStartupLocation="CenterOwner" Title="{Binding Property.Name, StringFormat={x:Static prop:Resources.CollectionEditorTitle},Mode=OneTime}"> + <local:WindowEx.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="Themes/Resources.xaml" /> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </local:WindowEx.Resources> <Grid Margin="12"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> @@ -25,6 +32,18 @@ <TextBlock Text="{x:Static prop:Resources.Properties}" Grid.Row="0" Grid.Column="1" Margin="12,0,0,0" /> <ListBox ItemsSource="{Binding Targets,Mode=OneTime}" SelectedItem="{Binding SelectedTarget,Mode=TwoWay}" Margin="0,4,0,0" Grid.Column="0" Grid.Row="1"> + <ListBox.ItemContainerStyle> + <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> + <Setter Property="AutomationProperties.Name"> + <Setter.Value> + <MultiBinding StringFormat="{}[{0}] {1}"> + <Binding Path="Row" /> + <Binding Mode="OneTime" Path="TypeName" /> + </MultiBinding> + </Setter.Value> + </Setter> + </Style> + </ListBox.ItemContainerStyle> <ListBox.ItemTemplate> <DataTemplate> <TextBlock> @@ -46,11 +65,17 @@ </Grid.ColumnDefinitions> <StackPanel Orientation="Horizontal" Grid.Column="0"> - <Button Command="{Binding RemoveTargetCommand,Mode=OneTime}" ToolTip="{x:Static prop:Resources.RemoveItem}" MinWidth="29" FontFamily="Segoe UI Symbol" Content="❌" /> + <Button Command="{Binding RemoveTargetCommand,Mode=OneTime}" ToolTip="{x:Static prop:Resources.RemoveItem}" AutomationProperties.Name="{x:Static prop:Resources.RemoveItem}" MinWidth="29" FontFamily="Segoe UI Symbol" Content="❌" /> <Button Command="{Binding MoveUpCommand,Mode=OneTime}" ToolTip="{x:Static prop:Resources.MoveItemUp}" AutomationProperties.Name="{x:Static prop:Resources.MoveItemUp}" MinWidth="29" Margin="4,0,0,0" FontFamily="Segoe UI Symbol" Content="⭡" /> <Button Command="{Binding MoveDownCommand,Mode=OneTime}" ToolTip="{x:Static prop:Resources.MoveItemDown}" AutomationProperties.Name="{x:Static prop:Resources.MoveItemDown}" MinWidth="29" Margin="4,0,0,0" FontFamily="Segoe UI Symbol" Content="⭣" /> </StackPanel> - <ComboBox Grid.Column="1" ItemsSource="{Binding SuggestedTypes}" DisplayMemberPath="Name" SelectedItem="{Binding SelectedType,Mode=TwoWay}" Margin="12,0,0,0" /> + <ComboBox Grid.Column="1" DisplayMemberPath="Name" ItemsSource="{Binding SuggestedTypes}" SelectedItem="{Binding SelectedType,Mode=TwoWay}" AutomationProperties.Name="{x:Static prop:Resources.AccessibilityCollectionTypeSelector}" Margin="12,0,0,0"> + <ComboBox.ItemContainerStyle> + <Style TargetType="ComboBoxItem"> + <Setter Property="AutomationProperties.Name" Value="{Binding Name,Mode=OneTime}" /> + </Style> + </ComboBox.ItemContainerStyle> + </ComboBox> <Button Grid.Column="2" Command="{Binding AddTargetCommand,Mode=OneTime}" Margin="4,0,0,0" Content="{x:Static prop:Resources.AddCollectionItem}" /> </Grid> diff --git a/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml b/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml index 1996520..263066e 100644 --- a/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml +++ b/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml @@ -305,7 +305,7 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:BoolEditorControl"> - <CheckBox Name="CheckBox" Height="{TemplateBinding Height}" VerticalContentAlignment="Center" AutomationProperties.Name="{Binding Property.Name,Mode=OneTime}" IsChecked="{Binding Value}" IsEnabled="{Binding Property.CanWrite,Mode=OneTime}" VerticalAlignment="Center" /> + <CheckBox Name="CheckBox" Height="{TemplateBinding Height}" FocusVisualStyle="{DynamicResource EmptyCheckBoxFocusVisualSquare}" VerticalContentAlignment="Center" AutomationProperties.Name="{Binding Property.Name,Mode=OneTime}" IsChecked="{Binding Value}" IsEnabled="{Binding Property.CanWrite,Mode=OneTime}" VerticalAlignment="Center" /> </ControlTemplate> </Setter.Value> </Setter> @@ -831,6 +831,7 @@ </local:BrushChoiceTemplateSelector> <Style TargetType="local:BrushTabbedEditorControl"> + <Setter Property="Focusable" Value="False" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:BrushTabbedEditorControl"> @@ -2822,15 +2823,9 @@ </Style> <Style x:Key="EmptyCheckBoxFocusVisualSquare" TargetType="Control" BasedOn="{StaticResource GenericVisualFocusStyle}"> - <Setter Property="Margin" Value="-3,0,0,0" /> - <Setter Property="Width" Value="22" /> - <Setter Property="Height" Value="21" /> + <Setter Property="Margin" Value="-1" /> + <Setter Property="Width" Value="18" /> <Setter Property="HorizontalAlignment" Value="Left" /> - <Setter Property="VerticalAlignment" Value="Center" /> - </Style> - - <Style TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}"> - <Setter Property="FocusVisualStyle" Value="{StaticResource EmptyCheckBoxFocusVisualSquare}" /> </Style> <Style TargetType="{x:Type ComboBoxItem}"> |