Skip to content

Commit

Permalink
changable background for checkbox and radiobutton
Browse files Browse the repository at this point in the history
Closes #1906 Change the background color of a checkbox ?
  • Loading branch information
punker76 committed Jul 28, 2015
1 parent 683c0ac commit 9e90d4e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions MahApps.Metro/Styles/Controls.CheckBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
Value="6,0,0,0" />
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="BorderBrush"
Value="{DynamicResource CheckBoxBrush}" />
<Setter Property="Controls:ControlsHelper.FocusBorderBrush"
Value="{DynamicResource HighlightBrush}" />
<Setter Property="Controls:ControlsHelper.MouseOverBorderBrush"
Expand Down Expand Up @@ -75,9 +77,9 @@
<Rectangle Fill="{DynamicResource TransparentWhiteBrush}"
Margin="-6, 0" />
<Border x:Name="normal"
BorderBrush="{DynamicResource CheckBoxBrush}"
BorderThickness="1"
Background="{DynamicResource WhiteBrush}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Width="18"
Height="18" />
<Path x:Name="checkBox"
Expand All @@ -95,7 +97,7 @@
Opacity="0" />
<Border x:Name="disabled"
Opacity="0"
BorderThickness="1"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{DynamicResource SemiTransparentWhiteBrush}"
Width="18"
Height="18" />
Expand Down
10 changes: 6 additions & 4 deletions MahApps.Metro/Styles/Controls.RadioButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
Value="6,0,0,0" />
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="BorderBrush"
Value="{DynamicResource CheckBoxBrush}" />
<Setter Property="Controls:ControlsHelper.FocusBorderBrush"
Value="{DynamicResource HighlightBrush}" />
<Setter Property="Controls:ControlsHelper.MouseOverBorderBrush"
Expand Down Expand Up @@ -66,9 +68,9 @@
<Rectangle Fill="{DynamicResource TransparentWhiteBrush}"
Margin="-6,0" />
<Ellipse x:Name="normal"
Stroke="{DynamicResource CheckBoxBrush}"
StrokeThickness="1"
Fill="{DynamicResource WhiteBrush}"
Stroke="{TemplateBinding BorderBrush}"
StrokeThickness="{TemplateBinding BorderThickness}"
Fill="{TemplateBinding Background}"
Width="18"
Height="18" />
<Ellipse x:Name="Checked1"
Expand All @@ -78,7 +80,7 @@
Height="10" />
<Ellipse x:Name="disabled"
Opacity="0"
StrokeThickness="1"
StrokeThickness="{TemplateBinding BorderThickness}"
Fill="{DynamicResource SemiTransparentWhiteBrush}"
Width="18"
Height="18" />
Expand Down

0 comments on commit 9e90d4e

Please sign in to comment.