Skip to content

Commit

Permalink
Update resouces, add test UI (microsoft/microsoft-ui-xaml#3435)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinnara committed Oct 25, 2020
1 parent 76e1899 commit 3f1ab96
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 19 deletions.
1 change: 1 addition & 0 deletions ModernWpf/Styles/ComboBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@
<!-- Focused -->
<Trigger Property="primitives:FocusVisualHelper.ShowFocusVisual" Value="True">
<Setter TargetName="HighlightBackground" Property="Opacity" Value="1" />
<Setter TargetName="HighlightBackground" Property="Background" Value="{DynamicResource ComboBoxBackgroundFocused}" />
<Setter TargetName="HighlightBackground" Property="BorderBrush" Value="{DynamicResource ComboBoxBackgroundBorderBrushFocused}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ComboBoxForegroundFocused}" />
<Setter TargetName="PlaceholderTextBlock" Property="Foreground" Value="{DynamicResource ComboBoxPlaceHolderForegroundFocused}" />
Expand Down
1 change: 1 addition & 0 deletions ModernWpf/ThemeResources/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@
<m:StaticResource x:Key="ComboBoxBackgroundPressed" ResourceKey="SystemControlBackgroundListMediumBrush" />
<m:StaticResource x:Key="ComboBoxBackgroundDisabled" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<m:StaticResource x:Key="ComboBoxBackgroundUnfocused" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<m:StaticResource x:Key="ComboBoxBackgroundFocused" ResourceKey="ComboBoxBackgroundUnfocused" />
<m:StaticResource x:Key="ComboBoxBackgroundBorderBrushFocused" ResourceKey="SystemControlHighlightTransparentBrush" />
<m:StaticResource x:Key="ComboBoxBackgroundBorderBrushUnfocused" ResourceKey="SystemControlHighlightBaseMediumLowBrush" />
<m:StaticResource x:Key="ComboBoxForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
Expand Down
1 change: 1 addition & 0 deletions ModernWpf/ThemeResources/HighContrast.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@
<m:StaticResource x:Key="ComboBoxBackgroundPressed" ResourceKey="SystemControlBackgroundListMediumBrush" />
<m:StaticResource x:Key="ComboBoxBackgroundDisabled" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<m:StaticResource x:Key="ComboBoxBackgroundUnfocused" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<m:StaticResource x:Key="ComboBoxBackgroundFocused" ResourceKey="ComboBoxBackgroundUnfocused" />
<m:StaticResource x:Key="ComboBoxBackgroundBorderBrushFocused" ResourceKey="SystemControlHighlightTransparentBrush" />
<m:StaticResource x:Key="ComboBoxBackgroundBorderBrushUnfocused" ResourceKey="SystemControlHighlightBaseMediumLowBrush" />
<m:StaticResource x:Key="ComboBoxForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
Expand Down
1 change: 1 addition & 0 deletions ModernWpf/ThemeResources/Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@
<m:StaticResource x:Key="ComboBoxBackgroundPressed" ResourceKey="SystemControlBackgroundListMediumBrush" />
<m:StaticResource x:Key="ComboBoxBackgroundDisabled" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<m:StaticResource x:Key="ComboBoxBackgroundUnfocused" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<m:StaticResource x:Key="ComboBoxBackgroundFocused" ResourceKey="ComboBoxBackgroundUnfocused" />
<m:StaticResource x:Key="ComboBoxBackgroundBorderBrushFocused" ResourceKey="SystemControlHighlightTransparentBrush" />
<m:StaticResource x:Key="ComboBoxBackgroundBorderBrushUnfocused" ResourceKey="SystemControlHighlightBaseMediumLowBrush" />
<m:StaticResource x:Key="ComboBoxForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
Expand Down
45 changes: 26 additions & 19 deletions test/ModernWpfTestApp/ComboBoxPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,35 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<StackPanel
Background="{DynamicResource SystemControlPageBackgroundAltHighBrush}"
Margin="12">
<TextBlock
Text="Sample ComboBoxes"
Style="{DynamicResource StandardGroupHeader}" />
<TextBlock Text="ComboBox:" />
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="12">
<TextBlock Text="Sample ComboBoxes" Style="{ThemeResource StandardGroupHeader}"/>
<TextBlock Text="ComboBox:"/>
<ComboBox SelectedIndex="0">
<ComboBoxItem Content="Item 1" />
<ComboBoxItem Content="Item 2" />
<ComboBoxItem Content="Item 3" />
<ComboBoxItem Content="Item 1"/>
<ComboBoxItem Content="Item 2"/>
<ComboBoxItem Content="Item 3"/>
</ComboBox>

<TextBlock
Text="ComboBox IsEditable=true:"
Margin="0,20,0,0" />
<ComboBox
SelectedIndex="0"
IsEditable="True">
<ComboBoxItem Content="Item 1" />
<ComboBoxItem Content="Item 2" />
<ComboBoxItem Content="Item 3" />
<TextBlock Text="ComboBox IsEditable=true:" Margin="0,20,0,0"/>
<ComboBox SelectedIndex="0" IsEditable="True">
<ComboBoxItem Content="Item 1"/>
<ComboBoxItem Content="Item 2"/>
<ComboBoxItem Content="Item 3"/>
</ComboBox>

<ComboBoxEx SelectedIndex="0" Header="Focus resource lookup test">
<ComboBox.Resources>
<ResourceDictionary>
<SolidColorBrush x:Key="ComboBoxBackgroundFocused" Color="Green"/>
<SolidColorBrush x:Key="ComboBoxBackgroundUnfocused" Color="Red"/>
<SolidColorBrush x:Key="ComboBoxBackgroundBorderBrushFocused" Color="Blue"/>
<SolidColorBrush x:Key="ComboBoxBackgroundBorderBrushUnfocused" Color="Yellow"/>
</ResourceDictionary>
</ComboBox.Resources>
<ComboBoxItem Content="Item 1"/>
<ComboBoxItem Content="Item 2"/>
<ComboBoxItem Content="Item 3"/>
</ComboBoxEx>

</StackPanel>
</local:TestPage>

0 comments on commit 3f1ab96

Please sign in to comment.