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 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"/>
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ControlChromeBackgroundBrush}"/>
                        </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="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="MinWidth" Value="0"/>
        <Setter Property="MinHeight" Value="0"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <ScrollViewer x:Name="PART_ContentHost" Background="Transparent" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="ClickMode" Value="Press"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid>
                        <Border x:Name="templateRoot" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource CornerRadius}" SnapsToDevicePixels="True" Padding="{TemplateBinding Padding}">
                            <Border x:Name="splitBorder" BorderBrush="Transparent" BorderThickness="1" HorizontalAlignment="Right" Padding="5" SnapsToDevicePixels="true" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" MinHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" CornerRadius="3">
                                <Path x:Name="arrow" Data="F1 M 3.17891e-007,0.504217C 3.17891e-007,0.434237 0.0134338,0.368944 0.0403,0.30834C 0.067167,0.247734 0.103093,0.194939 0.148079,0.14995C 0.193065,0.104965 0.245861,0.0687275 0.306467,0.0412369C 0.367073,0.0137463 0.432365,0 0.502343,0C 0.57732,0 0.641987,0.0128078 0.696345,0.0384235C 0.750703,0.0640411 0.803499,0.101843 0.854733,0.151827L 4,3.29897L 7.14527,0.151827C 7.24648,0.0506077 7.36395,0 7.49765,0C 7.56763,0 7.63292,0.0137463 7.69353,0.0412369C 7.75414,0.0687275 7.80693,0.104965 7.85192,0.14995C 7.89691,0.194939 7.93283,0.247734 7.9597,0.30834C 7.98656,0.368944 8,0.434237 8,0.504217C 8,0.640425 7.95126,0.757263 7.85379,0.854731L 4.35239,4.35801C 4.25367,4.45548 4.13621,4.50422 4,4.50422C 3.86379,4.50422 3.74695,4.45548 3.64948,4.35801L 0.146204,0.854731C 0.048735,0.757263 3.17891e-007,0.640425 3.17891e-007,0.504217 Z "
                                      Fill="{StaticResource ControlBorderBrush}" HorizontalAlignment="Center" Margin="3" VerticalAlignment="Center"/>
                            </Border>
                        </Border>
                        <Border x:Name="underlineIsDefaulted" Height="{Binding ElementName=templateRoot, Path=ActualHeight}" Width="{Binding ElementName=templateRoot, Path=ActualWidth}" CornerRadius="{StaticResource CornerRadius}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true" Visibility="Hidden">
                            <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=templateRoot, Path=ActualHeight}" Width="{Binding ElementName=templateRoot, 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>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Visibility" TargetName="underlineIsDefaulted" Value="Visible" />
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
                                <Condition Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Visibility" TargetName="underlineIsSelected" Value="Visible" />
                            <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ControlChromeBackgroundBrush}"/>
                        </MultiDataTrigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Opacity" TargetName="templateRoot" Value="0.56"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ControlChromeBorderPointerOverBrush}"/>
                            <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ControlChromeBackgroundPointerOverBrush}"/>
                        </Trigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ControlChromeBorderPointerOverBrush}"/>
                            <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ControlChromeBackgroundPointerOverBrush}"/>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
                                <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Visibility" TargetName="underlineIsDefaulted" Value="Visible" />
                            <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ControlBackgroundPointerOverBrush}"/>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
                                <Condition Binding="{Binding IsMouseOver, ElementName=splitBorder}" Value="true"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ControlBackgroundPointerOverBrush}"/>
                        </MultiDataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
        <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
            </Grid.ColumnDefinitions>
            <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Placement="Relative" >
                <Border x:Name="dropDownBorder" Background="{StaticResource ControlBackgroundBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource CornerRadius}" SnapsToDevicePixels="true" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" MaxHeight="{TemplateBinding MaxDropDownHeight}" Margin="20" >
                    <Border.Effect>
                        <DropShadowEffect Direction="270" ShadowDepth="8" BlurRadius="20" Color="Black" Opacity="0.25" />
                    </Border.Effect>
                    <ScrollViewer x:Name="DropDownScrollViewer">
                        <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
                            <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
                                <Rectangle x:Name="opaqueRect" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
                            </Canvas>
                            <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Grid>
                    </ScrollViewer>
                </Border>
            </Popup>
            <ToggleButton x:Name="toggleButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxToggleButton}" Padding="2"/>
            <Border x:Name="border" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                <TextBox x:Name="PART_EditableTextBox" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}" Style="{StaticResource ComboBoxEditableTextBox}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
            </Border>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Opacity" TargetName="border" Value="0.56"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocusWithin" Value="true">
                <Setter Property="Foreground" Value="Black"/>
            </Trigger>
            <Trigger Property="HasItems" Value="false">
                <Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
            </Trigger>
            <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
                <!--<Setter Property="Margin" TargetName="shadow" Value="0,0,5,5"/>
                <Setter Property="Color" TargetName="shadow" Value="#71000000"/>-->
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsGrouping" Value="true"/>
                    <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
                </MultiTrigger.Conditions>
                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
            </MultiTrigger>
            <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
                <Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
                <Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsKeyboardFocused" Value="true"/>
                    <Condition Property="IsEditable" Value="true"/>
                </MultiTrigger.Conditions>
                <Setter Property="Visibility" TargetName="dropDownBorder" Value="Visible"/>
            </MultiTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}">
        <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
            </Grid.ColumnDefinitions>
            <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Placement="Relative" >
                <Border x:Name="dropDownBorder" Background="{StaticResource ControlBackgroundBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource CornerRadius}" SnapsToDevicePixels="true" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" MaxHeight="{TemplateBinding MaxDropDownHeight}" Margin="20" >
                    <Border.Effect>
                        <DropShadowEffect Direction="270" ShadowDepth="8" BlurRadius="20" Color="Black" Opacity="0.25" />
                    </Border.Effect>
                    <ScrollViewer x:Name="DropDownScrollViewer">
                        <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
                            <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
                                <Rectangle x:Name="opaqueRect" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
                            </Canvas>
                            <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Grid>
                    </ScrollViewer>
                </Border>
            </Popup>
            <ToggleButton x:Name="toggleButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxToggleButton}" Padding="2"/>
            <ContentPresenter x:Name="contentPresenter" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" Content="{TemplateBinding SelectionBoxItem}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="false" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="HasItems" Value="false">
                <Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsGrouping" Value="true"/>
                    <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
                </MultiTrigger.Conditions>
                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
            </MultiTrigger>
            <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
                <Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
                <Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="ComboBoxItemContainerStyle" TargetType="{x:Type ComboBoxItem}">
        <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="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                    <Grid x:Name="Container" Margin="1">
                        <Border x:Name="SelectedBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" CornerRadius="2" SnapsToDevicePixels="true">
                            <ContentPresenter RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center" Margin="10,3,3,3"/>
                        </Border>
                        <Border x:Name="SelectedLine" Background="{StaticResource AccentBrush}" CornerRadius="1" Margin="2" Width="3" Height="16" SnapsToDevicePixels="true" VerticalAlignment="Center" HorizontalAlignment="Left" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="SelectedLine"/>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Background" Value="{StaticResource ControlBackgroundPointerOverBrush}" TargetName="SelectedBorder"/>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
                                <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Background" Value="{StaticResource ControlBackgroundPointerOverBrush}" TargetName="SelectedBorder"/>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
                                <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Background" Value="{StaticResource ControlBackgroundPressedBrush}" TargetName="SelectedBorder"/>
                        </MultiDataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
    <Style TargetType="{x:Type ComboBox}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource NormalFocusVisual}"/>
        <Setter Property="Background" Value="{StaticResource ControlChromeBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlChromeBorderBrush}"/>
        <Setter Property="ItemContainerStyle" Value="{StaticResource ComboBoxItemContainerStyle}"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="Padding" Value="{StaticResource ComboBoxPadding}"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
        <Setter Property="Template" Value="{StaticResource ComboBoxTemplate}"/>
        <Style.Triggers>
            <Trigger Property="IsEditable" Value="true">
                <Setter Property="IsTabStop" Value="false"/>
                <Setter Property="Padding" Value="2"/>
                <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
            </Trigger>
        </Style.Triggers>
    </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 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="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Grid Margin="0,0,0,3">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="true" Padding="20,18">
                            <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="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Grid Margin="0,0,0,3">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="true" Padding="20,18">
                            <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="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="20,18">
                        <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"/>
        <Setter Property="Padding" Value="0"/>
        <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>
                            <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="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="20,18">
                        <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"/>
        <Setter Property="Padding" Value="0"/>
        <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>
                            <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>
 
</ResourceDictionary>