Assets/Style.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
 
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Theme.xaml" />
    </ResourceDictionary.MergedDictionaries>
 
    <Style x:Key="NormalFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border Margin="-3" BorderBrush="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" CornerRadius="6" BorderThickness="2"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
     
    <Style TargetType="{x:Type Button}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource NormalFocusVisual}"/>
        <Setter Property="Background" Value="{StaticResource ControlChromeBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlChromeBorderBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource WindowTextBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="{StaticResource ButtonPadding}"/>
        <Setter Property="Margin" Value="{StaticResource ButtonPadding}"/>
        <!--<Setter Property="ToolTip" Value="{Binding Content, RelativeSource={x:Static RelativeSource.Self}}" />-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource CornerRadius}" SnapsToDevicePixels="true">
                            <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <Border x:Name="underlineIsDefaulted" Height="{Binding ElementName=border, Path=ActualHeight}" Width="{Binding ElementName=border, Path=ActualWidth}" CornerRadius="{StaticResource CornerRadius}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
                            <Border.BorderBrush>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="{StaticResource ControlChromeUnderLine}" Offset="1"/>
                                    <GradientStop Color="#00000000" Offset="0.93"/>
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsDefaulted" Value="true">
                            <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderPointerOverBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderPressedBrush}"/>
                            <Setter Property="Visibility" TargetName="underlineIsDefaulted" Value="Hidden"/>
                            <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource ControlChromeForegroundPressedBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderDisabledBrush}"/>
                            <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource ControlChromeForegroundDisabledBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ActiveButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource NormalFocusVisual}"/>
        <Setter Property="Background" Value="{StaticResource ControlSelectedBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlSelectedBorderBrush}"/>
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="{StaticResource ButtonPadding}"/>
        <Setter Property="Margin" Value="{StaticResource ButtonPadding}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource CornerRadius}" SnapsToDevicePixels="true">
                            <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <Border x:Name="underlineIsDefaulted" Height="{Binding ElementName=border, Path=ActualHeight}" Width="{Binding ElementName=border, Path=ActualWidth}" CornerRadius="{StaticResource CornerRadius}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
                            <Border.BorderBrush>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="{StaticResource ControlSelectedUnderLine}" Offset="1"/>
                                    <GradientStop Color="#00000000" Offset="0.93"/>
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsDefaulted" Value="true">
                            <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlSelectedBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlSelectedBorderPointerOverBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlSelectedBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlSelectedBorderPressedBrush}"/>
                            <Setter Property="Visibility" TargetName="underlineIsDefaulted" Value="Hidden"/>
                            <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource ControlSelectedForegroundPressedBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlSelectedBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlSelectedBorderDisabledBrush}"/>
                            <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource ControlSelectedForegroundDisabledBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type ProgressBar}">
        <Setter Property="Foreground" Value="{StaticResource ControlSelectedBackgroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource ControlBorderBrush}"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="MinHeight" Value="3"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ProgressBar}">
                    <Grid x:Name="TemplateRoot">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Determinate"/>
                                <VisualState x:Name="Indeterminate">
                                    <Storyboard RepeatBehavior="Forever">
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Animation" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="0.4"/>
                                            <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0.4"/>
                                            <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0.6"/>
                                            <EasingDoubleKeyFrame KeyTime="0:0:2.7" Value="0.6"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <PointAnimationUsingKeyFrames Storyboard.TargetName="Animation" Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)">
                                            <EasingPointKeyFrame KeyTime="0" Value="-0.8,0.5"/>
                                            <EasingPointKeyFrame KeyTime="0:0:1.5" Value="1.8,0.5">
                                                <EasingPointKeyFrame.EasingFunction>
                                                    <SineEase EasingMode="EaseIn"/>
                                                </EasingPointKeyFrame.EasingFunction></EasingPointKeyFrame>
                                            <EasingPointKeyFrame KeyTime="0:0:1.5" Value="-1.6,0.5"/>
                                            <EasingPointKeyFrame KeyTime="0:0:2.7" Value="2.5,0.5">
                                                <EasingPointKeyFrame.EasingFunction>
                                                    <CubicEase EasingMode="EaseOut"/>
                                                </EasingPointKeyFrame.EasingFunction></EasingPointKeyFrame>
                                        </PointAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1"/>
                        <Rectangle x:Name="PART_Track"/>
                        <Grid x:Name="PART_Indicator" ClipToBounds="true" HorizontalAlignment="Left">
                            <Border x:Name="Indicator" Background="{TemplateBinding Foreground}" CornerRadius="1.5"/>
                            <Border x:Name="Animation" Background="{TemplateBinding Foreground}" RenderTransformOrigin="0.5,0.5" CornerRadius="1.5">
                                <Border.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </Border.RenderTransform>
                            </Border>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Orientation" Value="Vertical">
                            <Setter Property="LayoutTransform" TargetName="TemplateRoot">
                                <Setter.Value>
                                    <RotateTransform Angle="-90"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsIndeterminate" Value="true">
                            <Setter Property="Visibility" TargetName="Background" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="Indicator" Value="Collapsed"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type ToggleButton}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource NormalFocusVisual}"/>
        <Setter Property="Background" Value="{StaticResource ControlChromeBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlChromeBorderBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource WindowTextBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="{StaticResource ButtonPadding}"/>
        <Setter Property="Margin" Value="{StaticResource ButtonPadding}"/>
        <!--<Setter Property="ToolTip" Value="{Binding Content, RelativeSource={x:Static RelativeSource.Self}}" />-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid>
                        <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource CornerRadius}" SnapsToDevicePixels="true">
                            <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <Border x:Name="underlineIsDefaulted" Height="{Binding ElementName=border, Path=ActualHeight}" Width="{Binding ElementName=border, Path=ActualWidth}" CornerRadius="{StaticResource CornerRadius}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
                            <Border.BorderBrush>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="{StaticResource ControlChromeUnderLine}" Offset="1"/>
                                    <GradientStop Color="#00000000" Offset="0.93"/>
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
                                <Condition Binding="{Binding IsChecked, RelativeSource={RelativeSource Self}}" Value="false"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderPointerOverBrush}"/>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
                                <Condition Binding="{Binding IsChecked, RelativeSource={RelativeSource Self}}" Value="false"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderPressedBrush}"/>
                            <Setter Property="Visibility" TargetName="underlineIsDefaulted" Value="Hidden"/>
                            <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource ControlChromeForegroundPressedBrush}"/>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
                                <Condition Binding="{Binding IsChecked, RelativeSource={RelativeSource Self}}" Value="false"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderDisabledBrush}"/>
                            <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource ControlChromeForegroundDisabledBrush}"/>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsChecked, RelativeSource={RelativeSource Self}}" Value="true"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Background" Value="{StaticResource ControlSelectedBackgroundBrush}"/>
                            <Setter Property="BorderBrush" Value="{StaticResource ControlSelectedBorderBrush}"/>
                            <Setter Property="Foreground" Value="White"/>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
                                <Condition Binding="{Binding IsChecked, RelativeSource={RelativeSource Self}}" Value="true"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlSelectedBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlSelectedBorderPointerOverBrush}"/>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
                                <Condition Binding="{Binding IsChecked, RelativeSource={RelativeSource Self}}" Value="true"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlSelectedBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlSelectedBorderPressedBrush}"/>
                            <Setter Property="Visibility" TargetName="underlineIsDefaulted" Value="Hidden"/>
                            <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource ControlSelectedForegroundPressedBrush}"/>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
                                <Condition Binding="{Binding IsChecked, RelativeSource={RelativeSource Self}}" Value="true"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlSelectedBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlSelectedBorderDisabledBrush}"/>
                            <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource ControlSelectedForegroundDisabledBrush}"/>
                        </MultiDataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
    <Style TargetType="{x:Type TextBox}">
        <Setter Property="Background" Value="{StaticResource ControlChromeBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlChromeBorderBrush}"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="{StaticResource TextBoxPadding}"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Grid>
                        <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource CornerRadius}" SnapsToDevicePixels="True" Padding="{TemplateBinding Padding}">
                            <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
                        </Border>
                        <Border x:Name="underlineIsDefaulted" Height="{Binding ElementName=border, Path=ActualHeight}" Width="{Binding ElementName=border, Path=ActualWidth}" CornerRadius="{StaticResource CornerRadius}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
                            <Border.BorderBrush>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="{StaticResource ControlChromeUnderLine}" Offset="1"/>
                                    <GradientStop Color="Transparent" Offset="0.93"/>
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                        </Border>
                        <Border x:Name="underlineIsSelected" Height="{Binding ElementName=border, Path=ActualHeight}" Width="{Binding ElementName=border, Path=ActualWidth}" CornerRadius="{StaticResource CornerRadius}" BorderThickness="2" SnapsToDevicePixels="true" Visibility="Hidden">
                            <Border.BorderBrush>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="{StaticResource ControlSelectedBorder}" Offset=".95"/>
                                    <GradientStop Color="Transparent" Offset="0.92"/>
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Opacity" TargetName="border" Value="0.56"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderPointerOverBrush}"/>
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundPointerOverBrush}"/>
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter Property="Visibility" TargetName="underlineIsSelected" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
    <Style x:Key="RadioButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border Margin="-6,4" BorderBrush="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" CornerRadius="8" BorderThickness="2"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadioButtonOptionMarkFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border Margin="-6" BorderBrush="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" CornerRadius="8" BorderThickness="2"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type RadioButton}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource RadioButtonFocusVisual}"/>
        <Setter Property="Background" Value="{StaticResource ControlBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <!--<Setter Property="ToolTip" Value="{Binding Content, RelativeSource={x:Static RelativeSource.Self}}" />-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <Grid x:Name="templateRoot" Background="Transparent" SnapsToDevicePixels="True">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Border x:Name="radioButtonBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="100" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1,1,2,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Height="{Binding ElementName=markBackground, Path=ActualHeight}" Width="{Binding ElementName=markBackground, Path=ActualWidth}" />
                        <Ellipse x:Name="optionMarkPressed" Fill="{StaticResource WindowBackgroundBrush}" Width="10" Height="10" Opacity="0"/>
                        <Border x:Name="markBackground" Background="{StaticResource ControlSelectedBackgroundBrush}" BorderBrush="{StaticResource ControlSelectedBorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="100" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1,1,2,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Opacity="0">
                            <Grid x:Name="markGrid" Width="18" Height="18">
                                <Ellipse x:Name="optionMark" Fill="{StaticResource WindowBackgroundBrush}" Width="12" Height="12" Opacity="1"/>
                            </Grid>
                        </Border>
                        <ContentPresenter x:Name="contentPresenter" Grid.Column="1" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasContent" Value="true">
                            <Setter Property="FocusVisualStyle" Value="{StaticResource RadioButtonOptionMarkFocusVisual}"/>
                            <Setter Property="Padding" Value="4,-1,0,0"/>
                            <Setter Property="Margin" Value="5"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="radioButtonBorder" Value="{StaticResource ControlBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="radioButtonBorder" Value="{StaticResource ControlBorderPointerOverBrush}"/>
                            <Setter Property="Height" TargetName="optionMark" Value="14" />
                            <Setter Property="Width" TargetName="optionMark" Value="14" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="radioButtonBorder" Value="{StaticResource ControlBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="radioButtonBorder" Value="{StaticResource ControlBorderDisabledBrush}"/>
                            <Setter Property="Fill" TargetName="optionMark" Value="{StaticResource ControlForegroundDisabledBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" TargetName="radioButtonBorder" Value="{StaticResource ControlBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="radioButtonBorder" Value="{StaticResource ControlBorderPressedBrush}"/>
                            <Setter Property="Height" TargetName="optionMark" Value="10" />
                            <Setter Property="Width" TargetName="optionMark" Value="10" />
                            <Setter Property="Opacity" TargetName="optionMarkPressed" Value="1"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Opacity" TargetName="markBackground" Value="1"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter Property="Opacity" TargetName="markBackground" Value="0.56"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
    <Style x:Key="CheckBoxFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border Margin="-6,-6" BorderBrush="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" CornerRadius="8" BorderThickness="2"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="OptionMarkFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border Margin="-6" BorderBrush="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" CornerRadius="8" BorderThickness="2"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type CheckBox}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource CheckBoxFocusVisual}"/>
        <Setter Property="Background" Value="{StaticResource ControlBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <!--<Setter Property="ToolTip" Value="{Binding Content, RelativeSource={x:Static RelativeSource.Self}}" />-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <Grid x:Name="templateRoot" Background="Transparent" SnapsToDevicePixels="True">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Border x:Name="checkBoxBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" CornerRadius="{StaticResource CornerRadius}" Height="{Binding ElementName=markBackground, Path=ActualHeight}" Width="{Binding ElementName=markBackground, Path=ActualWidth}" />
                        <Border x:Name="markBackground" Background="{StaticResource ControlSelectedBackgroundBrush}" BorderBrush="{StaticResource ControlSelectedBorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" CornerRadius="{StaticResource CornerRadius}" Opacity="0" Padding="2">
                            <Grid>
                                <Path Height="12" Width="12" x:Name="optionMark" Data="F1 M 8.67721,13.8647C 8.75363,13.8647 8.83127,13.8493 8.91013,13.8184C 8.98899,13.7875 9.05607,13.7444 9.11135,13.6891L 14.965,7.83544C 15.0821,7.71838 15.1406,7.57366 15.1406,7.4013C 15.1406,7.22894 15.0821,7.08422 14.965,6.96716C 14.8479,6.85008 14.7032,6.79154 14.5309,6.79154C 14.3585,6.79154 14.2138,6.85008 14.0967,6.96716L 8.67721,12.394L 6.18452,9.89399C 6.06745,9.77691 5.92273,9.71837 5.75038,9.71837C 5.57802,9.71837 5.4333,9.77691 5.31623,9.89399C 5.19916,10.0111 5.14062,10.1558 5.14062,10.3281C 5.14062,10.4045 5.15607,10.4822 5.18696,10.561C 5.21785,10.6399 5.26095,10.707 5.31623,10.7623L 8.24306,13.6891C 8.29834,13.7444 8.36542,13.7875 8.44428,13.8184C 8.52314,13.8493 8.60078,13.8647 8.67721,13.8647 Z " Fill="{StaticResource WindowBackgroundBrush}" Margin="1" Opacity="0" Stretch="Uniform" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                <Rectangle x:Name="indeterminateMark" Fill="{StaticResource WindowBackgroundBrush}" VerticalAlignment="Center" Height="1" Margin="3" Opacity="0"/>
                            </Grid>
                        </Border>
                        <ContentPresenter x:Name="contentPresenter" Grid.Column="1" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasContent" Value="true">
                            <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}"/>
                            <Setter Property="Padding" Value="5,2"/>
                            <Setter Property="Margin" Value="5"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="checkBoxBorder" Value="{StaticResource ControlBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="{StaticResource ControlBorderPointerOverBrush}"/>
                            <Setter Property="Background" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundPointerOverBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="checkBoxBorder" Value="{StaticResource ControlBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="{StaticResource ControlBorderDisabledBrush}"/>
                            <Setter Property="Fill" TargetName="optionMark" Value="{StaticResource ControlForegroundDisabledBrush}"/>
                            <Setter Property="Fill" TargetName="indeterminateMark" Value="{StaticResource ControlForegroundDisabledBrush}"/>
                            <Setter Property="Background" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundDisabledBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" TargetName="checkBoxBorder" Value="{StaticResource ControlBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="{StaticResource ControlBorderPressedBrush}"/>
                            <Setter Property="Fill" TargetName="optionMark" Value="{StaticResource WindowBackgroundBrush}"/>
                            <Setter Property="Fill" TargetName="indeterminateMark" Value="{StaticResource WindowBackgroundBrush}"/>
                            <Setter Property="Background" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundPressedBrush}"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Opacity" TargetName="checkBoxBorder" Value="0"/>
                            <Setter Property="Opacity" TargetName="markBackground" Value="1"/>
                            <Setter Property="Opacity" TargetName="optionMark" Value="1"/>
                            <Setter Property="Opacity" TargetName="indeterminateMark" Value="0"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter Property="Opacity" TargetName="checkBoxBorder" Value="0"/>
                            <Setter Property="Opacity" TargetName="markBackground" Value="1"/>
                            <Setter Property="Opacity" TargetName="optionMark" Value="0"/>
                            <Setter Property="Opacity" TargetName="indeterminateMark" Value="1"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="UnCheckBoxStyle" TargetType="{x:Type CheckBox}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource CheckBoxFocusVisual}"/>
        <Setter Property="Background" Value="{StaticResource ControlBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <!--<Setter Property="ToolTip" Value="{Binding Content, RelativeSource={x:Static RelativeSource.Self}}" />-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <Grid x:Name="templateRoot" Background="Transparent" SnapsToDevicePixels="True">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Border x:Name="checkBoxBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" CornerRadius="{StaticResource CornerRadius}" Height="{Binding ElementName=markBackground, Path=ActualHeight}" Width="{Binding ElementName=markBackground, Path=ActualWidth}" />
                        <Border x:Name="markBackground" Background="{StaticResource ControlSelectedBackgroundBrush}" BorderBrush="{StaticResource ControlSelectedBorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" CornerRadius="{StaticResource CornerRadius}" Opacity="0" Padding="2">
                            <Grid>
                                <Path Height="12" Width="12" x:Name="optionMark" Data="F1 M 8.67721,13.8647C 8.75363,13.8647 8.83127,13.8493 8.91013,13.8184C 8.98899,13.7875 9.05607,13.7444 9.11135,13.6891L 14.965,7.83544C 15.0821,7.71838 15.1406,7.57366 15.1406,7.4013C 15.1406,7.22894 15.0821,7.08422 14.965,6.96716C 14.8479,6.85008 14.7032,6.79154 14.5309,6.79154C 14.3585,6.79154 14.2138,6.85008 14.0967,6.96716L 8.67721,12.394L 6.18452,9.89399C 6.06745,9.77691 5.92273,9.71837 5.75038,9.71837C 5.57802,9.71837 5.4333,9.77691 5.31623,9.89399C 5.19916,10.0111 5.14062,10.1558 5.14062,10.3281C 5.14062,10.4045 5.15607,10.4822 5.18696,10.561C 5.21785,10.6399 5.26095,10.707 5.31623,10.7623L 8.24306,13.6891C 8.29834,13.7444 8.36542,13.7875 8.44428,13.8184C 8.52314,13.8493 8.60078,13.8647 8.67721,13.8647 Z " Fill="{StaticResource WindowBackgroundBrush}" Margin="1" Opacity="0" Stretch="Uniform" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                <Rectangle x:Name="indeterminateMark" Fill="{StaticResource WindowBackgroundBrush}" VerticalAlignment="Center" Height="1" Margin="3" Opacity="0"/>
                            </Grid>
                        </Border>
                        <ContentPresenter x:Name="contentPresenter" Grid.Column="1" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasContent" Value="true">
                            <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}"/>
                            <Setter Property="Padding" Value="5,2"/>
                            <Setter Property="Margin" Value="5"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="checkBoxBorder" Value="{StaticResource ControlBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="{StaticResource ControlBorderPointerOverBrush}"/>
                            <Setter Property="Background" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundPointerOverBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="checkBoxBorder" Value="{StaticResource ControlBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="{StaticResource ControlBorderDisabledBrush}"/>
                            <Setter Property="Fill" TargetName="optionMark" Value="{StaticResource ControlForegroundDisabledBrush}"/>
                            <Setter Property="Fill" TargetName="indeterminateMark" Value="{StaticResource ControlForegroundDisabledBrush}"/>
                            <Setter Property="Background" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundDisabledBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" TargetName="checkBoxBorder" Value="{StaticResource ControlBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="{StaticResource ControlBorderPressedBrush}"/>
                            <Setter Property="Fill" TargetName="optionMark" Value="{StaticResource WindowBackgroundBrush}"/>
                            <Setter Property="Fill" TargetName="indeterminateMark" Value="{StaticResource WindowBackgroundBrush}"/>
                            <Setter Property="Background" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundPressedBrush}"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter Property="Opacity" TargetName="checkBoxBorder" Value="0"/>
                            <Setter Property="Opacity" TargetName="markBackground" Value="1"/>
                            <Setter Property="Opacity" TargetName="optionMark" Value="1"/>
                            <Setter Property="Opacity" TargetName="indeterminateMark" Value="0"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter Property="Opacity" TargetName="checkBoxBorder" Value="0"/>
                            <Setter Property="Opacity" TargetName="markBackground" Value="1"/>
                            <Setter Property="Opacity" TargetName="optionMark" Value="0"/>
                            <Setter Property="Opacity" TargetName="indeterminateMark" Value="1"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
 
    <Style BasedOn="{StaticResource {x:Type Hyperlink}}" TargetType="{x:Type Hyperlink}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource NormalFocusVisual}"/>
        <Setter Property="Foreground" Value="{StaticResource AccentBrush}"/>
        <Setter Property="ToolTip" Value="{Binding NavigateUri, RelativeSource={x:Static RelativeSource.Self}}" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Foreground" Value="{StaticResource ControlSelectedUnderLineBrush}" />
                <Setter Property="Background" Value="{StaticResource ControlBackgroundPointerOverBrush}" />
            </Trigger>
        </Style.Triggers>
    </Style>
 
    <Style BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="{x:Type ListBoxItem}">
        <Setter Property="Padding" Value="5"/>
    </Style>
 
    <Style BasedOn="{StaticResource {x:Type ItemsControl}}" TargetType="{x:Type ItemsControl}">
        <Setter Property="Focusable" Value="False"/>
    </Style>
 
    <Style BasedOn="{StaticResource {x:Type ScrollViewer}}" TargetType="{x:Type ScrollViewer}">
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="PanningMode" Value="Both"/>
    </Style>
     
    <Style BasedOn="{StaticResource {x:Type TextBlock}}" TargetType="{x:Type TextBlock}">
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="TextTrimming" Value="CharacterEllipsis"/>
    </Style>
 
    <Style x:Key="{x:Type MenuItem}" TargetType="{x:Type MenuItem}">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Foreground" Value="{StaticResource WindowTextBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="{StaticResource ButtonPadding}"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource NormalFocusVisual}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Grid>
                        <Border x:Name="border" Background="{TemplateBinding Background}" CornerRadius="{StaticResource CornerRadius}" SnapsToDevicePixels="true">
                            <StackPanel HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Orientation="Horizontal">
                                <ContentPresenter x:Name="iconPresenter" ContentSource="Icon" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                <ContentPresenter x:Name="headerPresenter" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </StackPanel>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlBorderPointerOverBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlBorderPressedBrush}"/>
                            <Setter Property="TextElement.Foreground" TargetName="iconPresenter" Value="{StaticResource ControlChromeForegroundPressedBrush}"/>
                            <Setter Property="TextElement.Foreground" TargetName="headerPresenter" Value="{StaticResource ControlChromeForegroundPressedBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlBorderDisabledBrush}"/>
                            <Setter Property="TextElement.Foreground" TargetName="iconPresenter" Value="{StaticResource ControlForegroundDisabledBrush}"/>
                            <Setter Property="TextElement.Foreground" TargetName="headerPresenter" Value="{StaticResource ControlForegroundDisabledBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
    <Style TargetType="{x:Type ContextMenu}">
        <Setter Property="Background" Value="{StaticResource ControlChromeBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlChromeBorderBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource WindowTextBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="4"/>
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Grid.IsSharedSizeScope" Value="true" />
        <Setter Property="HasDropShadow" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContextMenu}">
                    <Grid>
                        <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource CornerRadius}" SnapsToDevicePixels="true">
                            <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
    <Style x:Key="VerticalListBoxItemContainerStyle" BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="{x:Type ListBoxItem}">
        <Setter Property="Background" Value="{StaticResource ControlChromeBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlChromeBorderBrush}"/>
        <Setter Property="Focusable" Value="False" />
        <Setter Property="IsEnabled" Value="{Binding IsEnabled}" />
        <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
        <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
        <Setter Property="Padding" Value="20,18" />
        <Setter Property="Margin" Value="0,0,0,3" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Grid Margin="{TemplateBinding Margin}">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="true" Padding="{TemplateBinding Padding}">
                            <DockPanel LastChildFill="False">
                                <ContentPresenter DockPanel.Dock="Right" MinWidth="40" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
                                <StackPanel VerticalAlignment="Center">
                                    <TextBlock Text="{TemplateBinding Tag}" FontWeight="{TemplateBinding FontWeight}" TextWrapping="Wrap" />
                                    <TextBlock Text="{TemplateBinding AutomationProperties.HelpText}" Foreground="{StaticResource ControlChromeForegroundPressedBrush}" FontWeight="Normal" FontSize="12" TextWrapping="Wrap" />
                                </StackPanel>
                            </DockPanel>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
    <Style x:Key="MinimumVerticalListBoxItemContainerStyle" BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="{x:Type ListBoxItem}">
        <Setter Property="Background" Value="{StaticResource ControlChromeBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlChromeBorderBrush}"/>
        <Setter Property="Focusable" Value="False" />
        <Setter Property="IsEnabled" Value="{Binding IsEnabled}" />
        <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
        <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment,RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
        <Setter Property="Margin" Value="0,0,0,3" />
        <Setter Property="Padding" Value="20,18" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Grid Margin="{TemplateBinding Margin}">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="true" Padding="{TemplateBinding Padding}">
                            <DockPanel LastChildFill="False">
                                <TextBlock Text="{TemplateBinding Tag}" FontWeight="{TemplateBinding FontWeight}" VerticalAlignment="Center" TextWrapping="Wrap" />
                                <ContentPresenter DockPanel.Dock="Right" MinWidth="40" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
                            </DockPanel>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
     
    <Style x:Key="ExpanderHeaderFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Border Margin="-3" BorderBrush="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" CornerRadius="6" BorderThickness="2"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
     
    <Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
        <Setter Property="Padding" Value="20,18" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border x:Name="border" BorderBrush="{StaticResource ControlChromeBorderBrush}" BorderThickness="1" Background="{StaticResource ControlChromeBackgroundBrush}" CornerRadius="3" SnapsToDevicePixels="true" Padding="{TemplateBinding Padding}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="19"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel VerticalAlignment="Center" MinWidth="300">
                                <TextBlock Text="{TemplateBinding Tag}" />
                                <TextBlock Text="{TemplateBinding AutomationProperties.HelpText}" Foreground="#5F5F5F" FontSize="12" />
                            </StackPanel>
                            <Path x:Name="arrow" Grid.Column="1" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" Stroke="{StaticResource ControlChromeForegroundPressedBrush}" SnapsToDevicePixels="false" StrokeThickness="2" VerticalAlignment="Center"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderPointerOverBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderPressedBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderDisabledBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ExpanderStyle" TargetType="{x:Type Expander}">
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Margin" Value="0,0,0,3"/>
        <Setter Property="Padding" Value="20,18" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Expander}">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" Margin="{TemplateBinding Margin}" SnapsToDevicePixels="true">
                        <DockPanel>
                            <ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" Tag="{TemplateBinding Header}" AutomationProperties.HelpText="{TemplateBinding AutomationProperties.HelpText}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" DockPanel.Dock="Top" FontStretch="{TemplateBinding FontStretch}" Foreground="{TemplateBinding Foreground}" FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" FontStyle="{TemplateBinding FontStyle}" FontFamily="{TemplateBinding FontFamily}" FontWeight="{TemplateBinding FontWeight}" FontSize="{TemplateBinding FontSize}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" Style="{StaticResource ExpanderDownHeaderStyle}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            <ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="20,0,0,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/>
                        </DockPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsExpanded" Value="true">
                            <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="MinimumExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
        <Setter Property="Padding" Value="20,18" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border x:Name="border" BorderBrush="{StaticResource ControlChromeBorderBrush}" BorderThickness="1" Background="{StaticResource ControlChromeBackgroundBrush}" CornerRadius="3" SnapsToDevicePixels="true" Padding="{TemplateBinding Padding}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="19"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel VerticalAlignment="Center" MinWidth="300">
                                <TextBlock Text="{TemplateBinding Tag}" />
                            </StackPanel>
                            <Path x:Name="arrow" Grid.Column="1" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" Stroke="{StaticResource ControlChromeForegroundPressedBrush}" SnapsToDevicePixels="false" StrokeThickness="2" VerticalAlignment="Center"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderPointerOverBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderPressedBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderDisabledBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="MinimumExpanderStyle" TargetType="{x:Type Expander}">
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="IsExpanded" Value="True"/>
        <Setter Property="Margin" Value="0,0,0,3"/>
        <Setter Property="Padding" Value="20,18" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Expander}">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" Margin="{TemplateBinding Margin}" SnapsToDevicePixels="true">
                        <DockPanel>
                            <ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" Tag="{TemplateBinding Header}" AutomationProperties.HelpText="{TemplateBinding AutomationProperties.HelpText}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" DockPanel.Dock="Top" FontStretch="{TemplateBinding FontStretch}" Foreground="{TemplateBinding Foreground}" FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" FontStyle="{TemplateBinding FontStyle}" FontFamily="{TemplateBinding FontFamily}" FontWeight="{TemplateBinding FontWeight}" FontSize="{TemplateBinding FontSize}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" Style="{StaticResource MinimumExpanderDownHeaderStyle}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            <ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="20,0,0,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/>
                        </DockPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsExpanded" Value="true">
                            <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CheckedExpanderStyle" TargetType="{x:Type Expander}">
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Margin" Value="0,0,0,3"/>
        <Setter Property="Padding" Value="20,18" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Expander}">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" SnapsToDevicePixels="true">
                        <DockPanel>
                            <Border x:Name="border" BorderBrush="{StaticResource ControlChromeBorderBrush}" BorderThickness="1" Background="{StaticResource ControlChromeBackgroundBrush}" CornerRadius="3" Margin="{TemplateBinding Margin}" SnapsToDevicePixels="true" Padding="{TemplateBinding Padding}" DockPanel.Dock="Top" >
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel VerticalAlignment="Center" MinWidth="300">
                                        <TextBlock Text="{TemplateBinding Header}" />
                                        <TextBlock Text="{TemplateBinding AutomationProperties.HelpText}" Foreground="#5F5F5F" FontSize="12" />
                                    </StackPanel>
                                    <CheckBox Grid.Column="1" IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" />
                                </Grid>
                            </Border>
                            <ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="20,0,0,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/>
                        </DockPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderPointerOverBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderDisabledBrush}"/>
                        </Trigger>
                        <Trigger Property="IsExpanded" Value="true">
                            <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CheckedMinimumExpanderStyle" TargetType="{x:Type Expander}">
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="IsExpanded" Value="True"/>
        <Setter Property="Margin" Value="0,0,0,3"/>
        <Setter Property="Padding" Value="20,18" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Expander}">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" Margin="{TemplateBinding Margin}" SnapsToDevicePixels="true">
                        <DockPanel>
                            <Border x:Name="border" BorderBrush="{StaticResource ControlChromeBorderBrush}" BorderThickness="1" Background="{StaticResource ControlChromeBackgroundBrush}" CornerRadius="3" SnapsToDevicePixels="true" Padding="{TemplateBinding Padding}" DockPanel.Dock="Top" >
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel VerticalAlignment="Center" MinWidth="300">
                                        <TextBlock Text="{TemplateBinding Header}" />
                                    </StackPanel>
                                    <CheckBox Grid.Column="1" IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" />
                                </Grid>
                            </Border>
                            <ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="20,0,0,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/>
                        </DockPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderPointerOverBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ControlChromeBorderDisabledBrush}"/>
                        </Trigger>
                        <Trigger Property="IsExpanded" Value="true">
                            <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
 
</ResourceDictionary>