<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="SwitchCheckBox" TargetType="CheckBox">
        <Setter Property="IsChecked" Value="False"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Foreground" Value="{StaticResource BackgroundColor}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Border x:Name="Status" Width="40" Height="20" CornerRadius="10">
                        <Grid>
                            <Border x:Name="border" Width="18" Height="18" Margin="1" CornerRadius="10" VerticalAlignment="Center" HorizontalAlignment="Left"  Background="White" BorderBrush="{StaticResource ThemeColor}" BorderThickness="0">
                                <Border.RenderTransform>
                                    <TranslateTransform  X="0"/>
                                </Border.RenderTransform>
                            </Border>
                            <TextBlock x:Name="txt" Text="{TemplateBinding Content}" Margin="4,0" VerticalAlignment="Center" Foreground="White" FontSize="8">
                                <TextBlock.RenderTransform>
                                    <TranslateTransform   X="17"></TranslateTransform>
                                </TextBlock.RenderTransform>
                            </TextBlock>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Text" TargetName="txt" Value="ON"/>
                            <Setter Property="Background" TargetName="Status" Value="#33c1a9"/>
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="20" Duration="00:00:0.2"/>
                                        <DoubleAnimation Storyboard.TargetName="txt" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="0" Duration="00:00:0.2"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="0" Duration="00:00:0.2"/>
                                        <DoubleAnimation Storyboard.TargetName="txt" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="18" Duration="00:00:0.2"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="False">
                            <Setter Property="Background" TargetName="Status" Value="DarkGray"/>
                            <Setter Property="Text" TargetName="txt" Value="OFF"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="chkBullet" TargetType="CheckBox">
        <Setter Property="IsChecked" Value="False"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Foreground" Value="{StaticResource TextColor}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Border x:Name="Status" Width="40" Height="20" CornerRadius="10">
                        <Grid>
                            <Border x:Name="border" Width="18" Height="18" Margin="1" CornerRadius="10" VerticalAlignment="Center" HorizontalAlignment="Left"  Background="White" BorderBrush="{StaticResource ThemeColor}" BorderThickness="0">
                                <Border.RenderTransform>
                                    <TranslateTransform  X="0"/>
                                </Border.RenderTransform>
                            </Border>
                            <TextBlock x:Name="txt" Text="{TemplateBinding Content}" Margin="4,0" VerticalAlignment="Center" Foreground="White" FontSize="8">
                                <TextBlock.RenderTransform>
                                    <TranslateTransform   X="17"></TranslateTransform>
                                </TextBlock.RenderTransform>
                            </TextBlock>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Text" TargetName="txt" Value=""/>
                            <Setter Property="Background" TargetName="Status" Value="{StaticResource NormalColor}"/>
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="20" Duration="00:00:0.2"/>
                                        <DoubleAnimation Storyboard.TargetName="txt" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="0" Duration="00:00:0.2"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="0" Duration="00:00:0.2"/>
                                        <DoubleAnimation Storyboard.TargetName="txt" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="18" Duration="00:00:0.2"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="False">
                            <Setter Property="Background" TargetName="Status" Value="DarkGray"/>
                            <Setter Property="Text" TargetName="txt" Value=""/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="RectangleCheckBox" TargetType="CheckBox">
        <Setter Property="Margin" Value="1"/>
        <Setter Property="Background" Value="{StaticResource ThemeColor}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Grid  Margin="{TemplateBinding Margin}">
                        <ContentPresenter Panel.ZIndex="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        <Border x:Name="_borderOver" Background="Transparent" BorderBrush="Gray" BorderThickness="0.5" Margin="0" Width="16" Height="16" CornerRadius="4">

                            <Path Data="M2,5 5,8 10,1" Margin="0 0 0 0" VerticalAlignment="Center" HorizontalAlignment="Center" Stroke="White" StrokeThickness="2"/>
                            <!--<Border x:Name="_borderChecked" Visibility="Collapsed" Background="{StaticResource ThemeColor}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="16" Height="16" CornerRadius="4">-->
                            <!--</Border>-->
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasContent" Value="True">
                            <Setter Property="FocusVisualStyle">
                                <Setter.Value>
                                    <Style>
                                        <Setter Property="Control.Template">
                                            <Setter.Value>
                                                <ControlTemplate>
                                                    <Rectangle Margin="14,0,0,0" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </Setter.Value>
                            </Setter>

                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Background" TargetName="_borderOver" Value="{StaticResource ThemeColor}"/>
                            <!--<Setter Property="BorderBrush" TargetName="_borderOver" Value="Transparent"/>-->
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ThemeCheckBox" TargetType="CheckBox">
        <Setter Property="Margin" Value="1"/>
        <Setter Property="Background" Value="{StaticResource ThemeColor}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Border Background="{TemplateBinding Background}"  Margin="{TemplateBinding Margin}" CornerRadius="4">

                        <Grid >
                            <ContentPresenter Panel.ZIndex="0" VerticalAlignment="Center" HorizontalAlignment="Center" TextElement.Foreground="{StaticResource TextColor}" Margin="8,12"/>
                            <Border x:Name="_borderOver" Background="Transparent" BorderBrush="Transparent" BorderThickness="1" Margin="1">

                            </Border>
                            <Border x:Name="_borderChecked" Visibility="Collapsed" Background="{StaticResource SubThemeColor}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="12" Height="12">
                                <Path Data="M2,7 5,10 11,2" Margin="0 0 0 0" VerticalAlignment="Center" HorizontalAlignment="Center" Stroke="White" StrokeThickness="2"/>
                            </Border>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasContent" Value="True">
                            <Setter Property="FocusVisualStyle">
                                <Setter.Value>
                                    <Style>
                                        <Setter Property="Control.Template">
                                            <Setter.Value>
                                                <ControlTemplate>
                                                    <Rectangle Margin="14,0,0,0" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </Setter.Value>
                            </Setter>

                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" TargetName="_borderOver" Value="White"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Visibility" TargetName="_borderChecked" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="FunctionCheckBox" TargetType="CheckBox">
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Background" Value="{StaticResource ThemeColor}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Border Background="{TemplateBinding Background}"  Margin="{TemplateBinding Margin}" CornerRadius="4">

                        <Grid >
                            <ContentPresenter Panel.ZIndex="0" VerticalAlignment="Center" HorizontalAlignment="Center" TextElement.Foreground="{StaticResource TextColor}" Margin="0"/>
                            <Border x:Name="_borderOver" Background="Transparent" BorderBrush="Transparent" BorderThickness="1" Margin="1">

                            </Border>
                            <Border x:Name="_borderChecked" Visibility="Collapsed" Background="{StaticResource NiceGreen}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="12" Height="12">
                                <Path Data="M2,7 5,10 11,2" Margin="0 0 0 0" VerticalAlignment="Center" HorizontalAlignment="Center" Stroke="White" StrokeThickness="2"/>
                            </Border>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasContent" Value="True">
                            <Setter Property="FocusVisualStyle">
                                <Setter.Value>
                                    <Style>
                                        <Setter Property="Control.Template">
                                            <Setter.Value>
                                                <ControlTemplate>
                                                    <Rectangle Margin="14,0,0,0" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </Setter.Value>
                            </Setter>

                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" TargetName="_borderOver" Value="White"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Visibility" TargetName="_borderChecked" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>