Skip to content

Commit

Permalink
Merge pull request #3987 from MahApps/fix/3985-ColorPalette-ColorPicker
Browse files Browse the repository at this point in the history
Fix ColorPalette of ColorPicker
  • Loading branch information
punker76 committed Dec 1, 2020
2 parents d43eabe + d974edc commit f0ba628
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@
<Setter Property="mah:HeaderedControlHelper.HeaderVerticalContentAlignment" Value="Center" />
</Style>

<Style x:Key="MahApps.Styles.ColorPalette.ColorPickerDropDown"
BasedOn="{StaticResource MahApps.Styles.ColorPalette}"
TargetType="{x:Type mah:ColorPalette}">
<Setter Property="mah:ControlsHelper.ContentCharacterCasing" Value="Normal" />
</Style>

</ResourceDictionary>
</Application.Resources>
</Application>
1 change: 1 addition & 0 deletions src/MahApps.Metro/Controls/Helper/ControlsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static void SetDisabledVisualElementVisibility(UIElement element, Visibil
[AttachedPropertyBrowsableForType(typeof(DropDownButton))]
[AttachedPropertyBrowsableForType(typeof(SplitButton))]
[AttachedPropertyBrowsableForType(typeof(WindowCommands))]
[AttachedPropertyBrowsableForType(typeof(ColorPalette))]
public static CharacterCasing GetContentCharacterCasing(UIElement element)
{
return (CharacterCasing)element.GetValue(ContentCharacterCasingProperty);
Expand Down
9 changes: 7 additions & 2 deletions src/MahApps.Metro/Themes/ColorPicker/ColorPalette.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
</Border>
</DataTemplate>

<Style x:Key="MahApps.Styles.ColorPalette" TargetType="mah:ColorPalette">
<Style x:Key="MahApps.Styles.ColorPalette" TargetType="{x:Type mah:ColorPalette}">
<Setter Property="BorderBrush" Value="{DynamicResource MahApps.Brushes.Accent}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Focusable" Value="False" />
Expand All @@ -138,9 +138,10 @@
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="mah:ColorPalette">
<ControlTemplate TargetType="{x:Type mah:ColorPalette}">
<GroupBox Margin="{TemplateBinding Margin}"
Padding="{TemplateBinding Padding}"
mah:ControlsHelper.ContentCharacterCasing="{TemplateBinding mah:ControlsHelper.ContentCharacterCasing}"
mah:HeaderedControlHelper.HeaderBackground="{TemplateBinding mah:HeaderedControlHelper.HeaderBackground}"
mah:HeaderedControlHelper.HeaderFontFamily="{TemplateBinding mah:HeaderedControlHelper.HeaderFontFamily}"
mah:HeaderedControlHelper.HeaderFontSize="{TemplateBinding mah:HeaderedControlHelper.HeaderFontSize}"
Expand Down Expand Up @@ -174,4 +175,8 @@
<Setter Property="mah:HeaderedControlHelper.HeaderForeground" Value="{DynamicResource MahApps.Brushes.IdealForeground}" />
</Style>

<Style x:Key="MahApps.Styles.ColorPalette.ColorPickerDropDown"
BasedOn="{StaticResource MahApps.Styles.ColorPalette}"
TargetType="{x:Type mah:ColorPalette}" />

</ResourceDictionary>

0 comments on commit f0ba628

Please sign in to comment.