<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:smartui="clr-namespace:SmartUI.Controls"
                    xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding">
    <Style x:Key="SwitchDefaultStyle" TargetType="{x:Type smartui:Switch}">
        <Setter Property="MinWidth" Value="100"/>
        <Setter Property="Height" Value="23"/>
        <Setter Property="Margin" Value="3"/>
        <Setter Property="Background" Value="{DynamicResource BrandColor}"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type smartui:Switch}">
                    <WrapPanel Orientation="Horizontal" Cursor="{TemplateBinding Cursor}">
                        <Border Background="{TemplateBinding Background}" Width="50" Height="{TemplateBinding Height}" CornerRadius="{c:Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path='Height/2' }" Padding="2" Margin="3 0 5 0">
                            <Border x:Name="border" Background="White" Width="{c:Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path='(Height-4)'}" HorizontalAlignment="Left"
                                Height="{Binding RelativeSource={RelativeSource Mode=Self},Path=Width}" CornerRadius="{c:Binding RelativeSource={RelativeSource Mode=Self},Path='Width/2'}"/>
                        </Border>
                        <TextBlock x:Name="untext" Text="{TemplateBinding UnCheckText}" FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Background}"/>
                        <TextBlock x:Name="texted" Text="{TemplateBinding CheckedText}" FontSize="{TemplateBinding FontSize}" Visibility="Collapsed" Foreground="{DynamicResource SuccessColor}"/>
                    </WrapPanel>                    
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter TargetName="border" Property="HorizontalAlignment" Value="Right"/>
                            <Setter Property="Background" Value="{DynamicResource SuccessColor}"/>
                            <Setter TargetName="untext" Property="Visibility" Value="Collapsed"/>
                            <Setter TargetName="texted" Property="Visibility" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.3"/>
                            <Setter Property="Cursor" Value="No"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type smartui:Switch}" BasedOn="{StaticResource SwitchDefaultStyle}"/>
</ResourceDictionary>