Skip to content

Commit

Permalink
(GH-3136) Xaml formating
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Sep 2, 2019
1 parent b503e53 commit 01462e2
Showing 1 changed file with 67 additions and 66 deletions.
133 changes: 67 additions & 66 deletions src/MahApps.Metro/Styles/Controls.CheckBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,35 @@
<!-- ********************************** CheckBoxStyle ********************************** -->
<!-- adapted from http://brianlagunas.com/free-metro-light-and-dark-themes-for-wpf-and-silverlight-microsoft-controls/ -->
<Style x:Key="MahApps.Styles.CheckBox" TargetType="CheckBox">
<Setter Property="BorderBrush" Value="{DynamicResource MahApps.Brushes.CheckBox}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Controls:CheckBoxHelper.CheckedBackgroundBrush" Value="{DynamicResource MahApps.Brushes.White}" />
<Setter Property="Controls:CheckBoxHelper.UnCheckedBackgroundBrush" Value="{DynamicResource MahApps.Brushes.White}" />
<Setter Property="Controls:CheckBoxHelper.IntermediateBackgroundBrush" Value="{DynamicResource MahApps.Brushes.White}" />
<Setter Property="Controls:CheckBoxHelper.CheckedBorderBrush" Value="{DynamicResource MahApps.Brushes.CheckBox}" />
<Setter Property="Controls:CheckBoxHelper.UnCheckedBorderBrush" Value="{DynamicResource MahApps.Brushes.CheckBox}" />
<Setter Property="Controls:CheckBoxHelper.CheckedGlyphTemplate">
<Setter.Value>
<DataTemplate>
<Path Width="12"
Height="10"
Data="M 1145.607177734375,430 C1145.607177734375,430 1141.449951171875,435.0772705078125 1141.449951171875,435.0772705078125 1141.449951171875,435.0772705078125 1139.232177734375,433.0999755859375 1139.232177734375,433.0999755859375 1139.232177734375,433.0999755859375 1138,434.5538330078125 1138,434.5538330078125 1138,434.5538330078125 1141.482177734375,438 1141.482177734375,438 1141.482177734375,438 1141.96875,437.9375 1141.96875,437.9375 1141.96875,437.9375 1147,431.34619140625 1147,431.34619140625 1147,431.34619140625 1145.607177734375,430 1145.607177734375,430 z"
Fill="{DynamicResource MahApps.Brushes.Highlight}"
Stretch="Fill"
UseLayoutRounding="False" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Controls:CheckBoxHelper.IntermediateBackgroundBrush" Value="{DynamicResource MahApps.Brushes.White}" />
<Setter Property="Controls:CheckBoxHelper.IntermediateBorderBrush" Value="{DynamicResource MahApps.Brushes.CheckBox}" />
<Setter Property="BorderBrush" Value="{DynamicResource MahApps.Brushes.CheckBox}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Controls:CheckBoxHelper.IntermediateGlyphTemplate">
<Setter.Value>
<DataTemplate>
<Rectangle Width="8"
Height="3"
Fill="{DynamicResource MahApps.Brushes.Gray3}" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Controls:CheckBoxHelper.UnCheckedBackgroundBrush" Value="{DynamicResource MahApps.Brushes.White}" />
<Setter Property="Controls:CheckBoxHelper.UnCheckedBorderBrush" Value="{DynamicResource MahApps.Brushes.CheckBox}" />
<Setter Property="Controls:ControlsHelper.FocusBorderBrush" Value="{DynamicResource MahApps.Brushes.Highlight}" />
<Setter Property="Controls:ControlsHelper.MouseOverBorderBrush" Value="{DynamicResource MahApps.Brushes.CheckBox.MouseOver}" />
<Setter Property="FontFamily" Value="{DynamicResource MahApps.Fonts.Content}" />
Expand All @@ -34,52 +55,52 @@
<Border x:Name="CheckedBorder"
Width="{TemplateBinding Controls:CheckBoxHelper.CheckBoxSize}"
Height="{TemplateBinding Controls:CheckBoxHelper.CheckBoxSize}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="{TemplateBinding Controls:CheckBoxHelper.CheckedBackgroundBrush}"
BorderBrush="{TemplateBinding Controls:CheckBoxHelper.CheckedBorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
CornerRadius="{TemplateBinding Controls:ControlsHelper.CornerRadius}"
Opacity="0">
<ContentControl Focusable="False"
IsTabStop="False"
Content="{TemplateBinding Controls:CheckBoxHelper.CheckedGlyph}"
ContentTemplate="{TemplateBinding Controls:CheckBoxHelper.CheckedGlyphTemplate}"/>
Opacity="0"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<ContentControl Content="{TemplateBinding Controls:CheckBoxHelper.CheckedGlyph}"
ContentTemplate="{TemplateBinding Controls:CheckBoxHelper.CheckedGlyphTemplate}"
Focusable="False"
IsTabStop="False" />
</Border>

<Border x:Name="UnCheckedBorder"
Width="{TemplateBinding Controls:CheckBoxHelper.CheckBoxSize}"
Height="{TemplateBinding Controls:CheckBoxHelper.CheckBoxSize}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="{TemplateBinding Controls:CheckBoxHelper.UnCheckedBackgroundBrush}"
BorderBrush="{TemplateBinding Controls:CheckBoxHelper.UnCheckedBorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
CornerRadius="{TemplateBinding Controls:ControlsHelper.CornerRadius}"
Opacity="0">
<ContentControl Focusable="False"
IsTabStop="False"
Content="{TemplateBinding Controls:CheckBoxHelper.UnCheckedGlyph}"
ContentTemplate="{TemplateBinding Controls:CheckBoxHelper.UnCheckedGlyphTemplate}"/>
Opacity="0"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<ContentControl Content="{TemplateBinding Controls:CheckBoxHelper.UnCheckedGlyph}"
ContentTemplate="{TemplateBinding Controls:CheckBoxHelper.UnCheckedGlyphTemplate}"
Focusable="False"
IsTabStop="False" />
</Border>

<Border x:Name="IntermediateBorder"
Width="{TemplateBinding Controls:CheckBoxHelper.CheckBoxSize}"
Height="{TemplateBinding Controls:CheckBoxHelper.CheckBoxSize}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="{TemplateBinding Controls:CheckBoxHelper.IntermediateBackgroundBrush}"
BorderBrush="{TemplateBinding Controls:CheckBoxHelper.IntermediateBorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
CornerRadius="{TemplateBinding Controls:ControlsHelper.CornerRadius}"
Opacity="0">
<ContentControl Focusable="False"
IsTabStop="False"
Content="{TemplateBinding Controls:CheckBoxHelper.IntermediateGlyph}"
ContentTemplate="{TemplateBinding Controls:CheckBoxHelper.IntermediateGlyphTemplate}"/>
Opacity="0"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<ContentControl Content="{TemplateBinding Controls:CheckBoxHelper.IntermediateGlyph}"
ContentTemplate="{TemplateBinding Controls:CheckBoxHelper.IntermediateGlyphTemplate}"
Focusable="False"
IsTabStop="False" />
</Border>

<Border x:Name="disabled"
Expand Down Expand Up @@ -126,7 +147,7 @@
Duration="0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" >
<VisualState x:Name="Unchecked">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="UnCheckedBorder"
Storyboard.TargetProperty="(UIElement.Opacity)"
Expand All @@ -148,31 +169,31 @@
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="CheckedBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.MouseOverBorderBrush)}" />
<Setter TargetName="UnCheckedBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.MouseOverBorderBrush)}" />
<Setter TargetName="IntermediateBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.MouseOverBorderBrush)}" />
<Setter TargetName="UnCheckedBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.MouseOverBorderBrush)}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="CheckedBorder" Property="BorderBrush" Value="{DynamicResource MahApps.Brushes.Highlight}" />
<Setter TargetName="UnCheckedBorder" Property="BorderBrush" Value="{DynamicResource MahApps.Brushes.Highlight}" />
<Setter TargetName="IntermediateBorder" Property="BorderBrush" Value="{DynamicResource MahApps.Brushes.Highlight}" />
<Setter TargetName="UnCheckedBorder" Property="BorderBrush" Value="{DynamicResource MahApps.Brushes.Highlight}" />
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter TargetName="CheckedBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.FocusBorderBrush)}" />
<Setter TargetName="UnCheckedBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.FocusBorderBrush)}" />
<Setter TargetName="IntermediateBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.FocusBorderBrush)}" />
<Setter TargetName="UnCheckedBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.FocusBorderBrush)}" />
</Trigger>
<Trigger Property="FlowDirection" Value="RightToLeft">
<Setter TargetName="CheckedBorder" Property="LayoutTransform">
<Setter.Value>
<ScaleTransform ScaleX="-1" />
</Setter.Value>
</Setter>
<Setter TargetName="UnCheckedBorder" Property="LayoutTransform">
<Setter TargetName="IntermediateBorder" Property="LayoutTransform">
<Setter.Value>
<ScaleTransform ScaleX="-1" />
</Setter.Value>
</Setter>
<Setter TargetName="IntermediateBorder" Property="LayoutTransform">
<Setter TargetName="UnCheckedBorder" Property="LayoutTransform">
<Setter.Value>
<ScaleTransform ScaleX="-1" />
</Setter.Value>
Expand All @@ -190,51 +211,31 @@
</Setter.Value>
</Setter>
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Controls:CheckBoxHelper.CheckedGlyphTemplate" >
<Setter.Value>
<DataTemplate>
<Path Width="12"
Height="10"
Data="M 1145.607177734375,430 C1145.607177734375,430 1141.449951171875,435.0772705078125 1141.449951171875,435.0772705078125 1141.449951171875,435.0772705078125 1139.232177734375,433.0999755859375 1139.232177734375,433.0999755859375 1139.232177734375,433.0999755859375 1138,434.5538330078125 1138,434.5538330078125 1138,434.5538330078125 1141.482177734375,438 1141.482177734375,438 1141.482177734375,438 1141.96875,437.9375 1141.96875,437.9375 1141.96875,437.9375 1147,431.34619140625 1147,431.34619140625 1147,431.34619140625 1145.607177734375,430 1145.607177734375,430 z"
Fill="{DynamicResource MahApps.Brushes.Highlight}"
Stretch="Fill"
UseLayoutRounding="False" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Controls:CheckBoxHelper.IntermediateGlyphTemplate" >
<Setter.Value>
<DataTemplate>
<Rectangle Width="8"
Height="3"
Fill="{DynamicResource MahApps.Brushes.Gray3}" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="MahApps.Styles.CheckBox.Win10" TargetType="CheckBox" BasedOn="{StaticResource MahApps.Styles.CheckBox}" >
<Style x:Key="MahApps.Styles.CheckBox.Win10"
BasedOn="{StaticResource MahApps.Styles.CheckBox}"
TargetType="CheckBox">
<Setter Property="BorderThickness" Value="2" />
<Setter Property="Controls:CheckBoxHelper.CheckBoxSize" Value="20" />
<Setter Property="Controls:CheckBoxHelper.CheckedBackgroundBrush" Value="{DynamicResource MahApps.Brushes.Accent}" />
<Setter Property="Controls:CheckBoxHelper.CheckedBorderBrush" Value="{DynamicResource MahApps.Brushes.Accent}" />
<Setter Property="Controls:CheckBoxHelper.CheckedGlyphTemplate" >
<Setter Property="Controls:CheckBoxHelper.CheckedGlyphTemplate">
<Setter.Value>
<DataTemplate>
<Path Stroke="{DynamicResource MahApps.Brushes.IdealForeground}"
Stretch="Uniform"
UseLayoutRounding="False"
HorizontalAlignment="Center"
<Path HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M90.890625,12.890625L95.109375,17.109375 30,82.265625 0.890625,53.109375 5.10937547683716,48.890625 30,73.734375 90.890625,12.890625z"/>
Data="M90.890625,12.890625L95.109375,17.109375 30,82.265625 0.890625,53.109375 5.10937547683716,48.890625 30,73.734375 90.890625,12.890625z"
Stretch="Uniform"
Stroke="{DynamicResource MahApps.Brushes.IdealForeground}"
UseLayoutRounding="False" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Controls:CheckBoxHelper.IntermediateGlyphTemplate" >
<Setter Property="Controls:CheckBoxHelper.IntermediateGlyphTemplate">
<Setter.Value>
<DataTemplate>
<Rectangle Margin="4"
Fill="{DynamicResource MahApps.Brushes.Gray3}" />
<Rectangle Margin="4" Fill="{DynamicResource MahApps.Brushes.Gray3}" />
</DataTemplate>
</Setter.Value>
</Setter>
Expand Down

0 comments on commit 01462e2

Please sign in to comment.