<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    mc:Ignorable="d">

    <Style TargetType="{x:Type CheckBox}" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Background" Value="{DynamicResource ControlBackgroundBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}" />
        <Setter Property="BorderThickness" Value="{DynamicResource ControlBorderThickness}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <Border Background="{TemplateBinding Background}"
                            Padding="{TemplateBinding Padding}">
                        <DockPanel>
                            <Border x:Name="BulletBorder" DockPanel.Dock="Left" CornerRadius="{DynamicResource ControlCornerRadius}"
                                    VerticalAlignment="Center"
                                    BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"
                                    BorderBrush="{TemplateBinding BorderBrush}">
                                <Grid Width="18" Height="18" Background="{DynamicResource CheckBoxCheckMarkBkBrush}">
                                    <Viewbox x:Name="CheckIcon" Visibility="Collapsed">
                                        <TextBlock Text="b" FontFamily="Marlett" Foreground="{DynamicResource GlyphBrush}"
                                                    HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Viewbox>
                                    <Viewbox x:Name="IndeterminateIcon" Visibility="Collapsed" Margin="2">
                                        <TextBlock Text="g" FontFamily="Marlett" Foreground="{DynamicResource GlyphBrush}"
                                                    HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Viewbox>
                                </Grid>
                            </Border>
                            <ContentPresenter DockPanel.Dock="Left" RecognizesAccessKey="True" Margin="5,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
                        </DockPanel>
                    </Border>                    
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsChecked" Value="{x:Null}" />
                                <Condition Property="IsThreeState" Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="IndeterminateIcon"/>
                        </MultiTrigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Visibility" Value="Visible" TargetName="CheckIcon" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource GlyphBrush}" TargetName="BulletBorder" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource GlyphBrush}" TargetName="BulletBorder" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>                  
</ResourceDictionary>