Skip to content

Commit

Permalink
(GH-3985) Allow override ContentCharacterCasing property for ColorPal…
Browse files Browse the repository at this point in the history
…ette
  • Loading branch information
punker76 committed Dec 1, 2020
1 parent 72c7bd4 commit 9bae8bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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
11 changes: 7 additions & 4 deletions src/MahApps.Metro/Themes/ColorPicker/ColorPalette.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:MahApps.Metro.Converters"
xmlns:mah="clr-namespace:MahApps.Metro.Controls"
Expand Down 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,6 +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}" />
<Style x:Key="MahApps.Styles.ColorPalette.ColorPickerDropDown"
BasedOn="{StaticResource MahApps.Styles.ColorPalette}"
TargetType="{x:Type mah:ColorPalette}" />

</ResourceDictionary>

0 comments on commit 9bae8bb

Please sign in to comment.