<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:vsm="clr-namespace:System.Windows;assembly=PresentationFramework"
                    xmlns:controls="clr-namespace:Ion.Sdk.DemoApp.Views.Controls"
                    mc:Ignorable="d">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Brushes.xaml" />
        <ResourceDictionary Source="Fonts.xaml" />
    </ResourceDictionary.MergedDictionaries>
    <!--==Common resources==-->
    <Thickness x:Key="Margin.Button">8 5</Thickness>
    <Thickness x:Key="Margin.Button.Horizontal">8 0</Thickness>
    <Thickness x:Key="Margin.Button.Horizontal.Left">8 0 0 0</Thickness>
    <Thickness x:Key="Margin.Button.Horizontal.Right">0 0 8 0</Thickness>
    <Thickness x:Key="Margin.Button.Vertical">0 5</Thickness>
    <Thickness x:Key="Margin.Button.Vertical.Top">0 5 0 0</Thickness>
    <Thickness x:Key="Margin.Button.Vertical.Bottom">0 0 0 5</Thickness>
    <Thickness x:Key="Margin.Button.Toolbar">1 2</Thickness>
    <Thickness x:Key="Margin.Text">5</Thickness>
    <Thickness x:Key="Margin.Text.Horizontal">5 0</Thickness>
    <Thickness x:Key="Margin.Text.Horizontal.Left">5 0 0 0</Thickness>
    <Thickness x:Key="Margin.Text.Horizontal.Right">0 0 5 0</Thickness>
    <Thickness x:Key="Margin.Text.Vertical">0 5</Thickness>
    <Thickness x:Key="Margin.Text.Vertical.Top">0 5 0 0</Thickness>
    <Thickness x:Key="Margin.Text.Vertical.Bottom">0 0 0 5</Thickness>
    <Thickness x:Key="Margin.Content">15 8</Thickness>
    <Thickness x:Key="Margin.Content.Horizontal">15 0</Thickness>
    <Thickness x:Key="Margin.Content.Horizontal.Left">15 0</Thickness>
    <Thickness x:Key="Margin.Content.Horizontal.Right">0 0 15 0</Thickness>
    <Thickness x:Key="Margin.Content.Vertical">0 8</Thickness>
    <Thickness x:Key="Margin.Content.Vertical.Top">0 8 0 0</Thickness>
    <Thickness x:Key="Margin.Content.Vertical.Bottom">0 0 0 8</Thickness>
    <Duration x:Key="Duration.Fast">0:0:0.3</Duration>
    <Duration x:Key="Duration.Slow">0:0:1.0</Duration>
    <Duration x:Key="Duration.Standard">0:0:0.6</Duration>
    <SineEase x:Key="Ease.Out"
              EasingMode="EaseOut" />
    <!--==FrameworkElement styles==-->
    <Style x:Key="Placeholder.ScaleY"
           TargetType="FrameworkElement">
        <Setter Property="LayoutTransform">
            <Setter.Value>
                <ScaleTransform ScaleY="0" />
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag, Mode=OneWay}"
                         Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.(ScaleTransform.ScaleY)"
                                             To="1"
                                             Duration="{StaticResource Duration.Fast}"
                                             EasingFunction="{StaticResource Ease.Out}" />
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.(ScaleTransform.ScaleY)"
                                             To="0"
                                             Duration="{StaticResource Duration.Fast}"
                                             EasingFunction="{StaticResource Ease.Out}" />
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.ExitActions>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="Element.FadeInOut"
           TargetType="FrameworkElement">
        <Setter Property="Opacity"
                Value="0" />
        <Setter Property="Visibility"
                Value="Hidden" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag, Mode=OneWay}"
                         Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0%">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                             To="1"
                                             Duration="{StaticResource Duration.Fast}" />
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="100%">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Hidden</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                             To="0"
                                             Duration="{StaticResource Duration.Fast}" />
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.ExitActions>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <!--==Error templates==-->
    <ControlTemplate x:Key="Validation.ErrorTemplate.Mini">
        <Grid DataContext="{Binding ElementName=ElementPlaceholder, Path=AdornedElement, Converter={StaticResource FrameworkElementToErrorTextConverter}, Mode=OneTime}">
            <Grid.RowDefinitions>
                <RowDefinition Height="auto" />
                <RowDefinition Height="auto" />
            </Grid.RowDefinitions>
            <Border x:Name="DescriptionBorder"
                    CornerRadius="0"
                    Background="{StaticResource Brush.Validation.Critical}"
                    HorizontalAlignment="Left"
                    Visibility="Hidden"
                    VerticalAlignment="Center">
                <TextBlock Text="{Binding Mode=OneTime}"
                           Style="{StaticResource TextBlock.Content}"
                           FontSize="{StaticResource Font.Size.Small}"
                           Foreground="{StaticResource Brush.White}"
                           Margin="5 2" />
            </Border>
            <Grid HorizontalAlignment="Left"
                  Grid.Row="1">
                <!--Rule error element placeholder-->
                <AdornedElementPlaceholder x:Name="ElementPlaceholder" />
                <Border x:Name="ErrorBorder"
                        BorderBrush="{StaticResource Brush.Validation.Critical}"
                        BorderThickness="1 0 0 0"
                        CornerRadius="0">
                    <Viewbox x:Name="ErrorMarker"
                             Stretch="Uniform"
                             Width="5"
                             HorizontalAlignment="Left"
                             VerticalAlignment="Top">
                        <Path Data="M 0,0 l 0,5 l 5,-5"
                              Fill="{StaticResource Brush.Validation.Critical}"
                              Stretch="Uniform" />
                    </Viewbox>
                </Border>
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>
            <!--Show error tooltip when control is focused-->
            <DataTrigger Binding="{Binding ElementName=ElementPlaceholder, Path=AdornedElement.IsKeyboardFocusWithin}"
                         Value="True">
                <Setter TargetName="DescriptionBorder"
                        Property="Visibility"
                        Value="Visible" />
                <Setter TargetName="ErrorBorder"
                        Property="CornerRadius"
                        Value="0" />
            </DataTrigger>
            <!--Show error tooltip when control (specified in Validation.ValidationAdornerSiteFor) is focused-->
            <DataTrigger Binding="{Binding ElementName=ElementPlaceholder, Path=AdornedElement.(Validation.ValidationAdornerSiteFor).IsKeyboardFocusWithin}"
                         Value="True">
                <Setter TargetName="DescriptionBorder"
                        Property="Visibility"
                        Value="Visible" />
                <Setter TargetName="ErrorBorder"
                        Property="CornerRadius"
                        Value="0" />
            </DataTrigger>
            <!--Show tooltip when mouse is over marker element-->
            <DataTrigger Binding="{Binding ElementName=ErrorMarker, Path=IsMouseOver}"
                         Value="True">
                <Setter TargetName="DescriptionBorder"
                        Property="Visibility"
                        Value="Visible" />
                <Setter TargetName="ErrorBorder"
                        Property="CornerRadius"
                        Value="0" />
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <!--==Default styles==-->
    <Style TargetType="{x:Type Control}">
        <Setter Property="Validation.ErrorTemplate"
                Value="{x:Null}" />
        <Setter Property="FontFamily"
                Value="Segoe UI" />
        <Setter Property="FontSize"
                Value="12" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="TextOptions.TextHintingMode"
                Value="Fixed" />
        <Setter Property="TextOptions.TextFormattingMode"
                Value="Display" />
        <Setter Property="TextOptions.TextRenderingMode"
                Value="ClearType" />
        <Setter Property="UseLayoutRounding"
                Value="False" />
        <Setter Property="FocusVisualStyle"
                Value="{x:Null}" />
    </Style>
    <!--==readolny text controls==-->
    <Style x:Key="TextBlock.Content"
           TargetType="TextBlock">
        <Setter Property="FontFamily"
                Value="Segoe UI" />
        <Setter Property="FontSize"
                Value="{StaticResource Font.Size.Normal}" />
        <Setter Property="TextWrapping"
                Value="NoWrap" />
        <Setter Property="TextTrimming"
                Value="CharacterEllipsis" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Foreground}" />
        <Setter Property="TextOptions.TextHintingMode"
                Value="Fixed" />
        <Setter Property="TextOptions.TextFormattingMode"
                Value="Display" />
        <Setter Property="TextOptions.TextRenderingMode"
                Value="ClearType" />
    </Style>
    <Style x:Key="TextBlock.Hint"
           TargetType="TextBlock"
           BasedOn="{StaticResource TextBlock.Content}">
        <Setter Property="IsHitTestVisible"
                Value="False" />
        <Setter Property="Visibility"
                Value="Collapsed" />
        <Setter Property="Opacity"
                Value="0.3" />
        <Setter Property="Margin"
                Value="5 4" />
        <Setter Property="FontSize"
                Value="{Binding RelativeSource={RelativeSource Self}, Path=(Tag).FontSize}" />
        <Setter Property="FontFamily"
                Value="{Binding RelativeSource={RelativeSource Self}, Path=(Tag).FontFamily}" />
        <Setter Property="FontStyle"
                Value="{Binding RelativeSource={RelativeSource Self}, Path=(Tag).FontStyle}" />
        <Setter Property="FontWeight"
                Value="{Binding RelativeSource={RelativeSource Self}, Path=(Tag).FontWeight}" />
        <Setter Property="Text"
                Value="{Binding RelativeSource={RelativeSource Self}, Path=(Tag).Text}" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Tag).Text}"
                         Value="">
                <Setter Property="Visibility"
                        Value="Visible" />
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="Label.Top"
           TargetType="{x:Type Label}">
        <Setter Property="Margin"
                Value="0 8 0 3" />
        <Setter Property="Padding"
                Value="0" />
        <Setter Property="FontFamily"
                Value="Segoe UI" />
        <Setter Property="FontSize"
                Value="{StaticResource Font.Size.Small}" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="TextOptions.TextHintingMode"
                Value="Fixed" />
        <Setter Property="TextOptions.TextFormattingMode"
                Value="Display" />
        <Setter Property="TextOptions.TextRenderingMode"
                Value="ClearType" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Separator.Strong}" />
    </Style>
    <Style x:Key="Label.Left"
           TargetType="{x:Type Label}">
        <Setter Property="Margin"
                Value="10 5 5 5" />
        <Setter Property="Padding"
                Value="0" />
        <Setter Property="FontFamily"
                Value="Segoe UI" />
        <Setter Property="FontSize"
                Value="{StaticResource Font.Size.Small}" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="TextOptions.TextHintingMode"
                Value="Fixed" />
        <Setter Property="TextOptions.TextFormattingMode"
                Value="Display" />
        <Setter Property="TextOptions.TextRenderingMode"
                Value="ClearType" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Separator.Strong}" />
    </Style>
    <!--Command buttons-->
    <Style x:Key="Button.Classic"
           TargetType="Button">
        <Setter Property="Validation.ErrorTemplate"
                Value="{x:Null}" />
        <Setter Property="Cursor"
                Value="Hand" />
        <Setter Property="HorizontalAlignment"
                Value="Stretch" />
        <Setter Property="HorizontalContentAlignment"
                Value="Stretch" />
        <Setter Property="VerticalAlignment"
                Value="Stretch" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />
        <Setter Property="MinWidth"
                Value="90" />
        <Setter Property="RenderOptions.ClearTypeHint"
                Value="Enabled" />
        <Setter Property="TextOptions.TextHintingMode"
                Value="Fixed" />
        <Setter Property="TextOptions.TextFormattingMode"
                Value="Display" />
        <Setter Property="TextOptions.TextRenderingMode"
                Value="ClearType" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Foreground}" />
        <Setter Property="Background"
                Value="{StaticResource Brush.Background.Strong}" />
        <Setter Property="BorderBrush"
                Value="{StaticResource Brush.Separator}" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="ToolTip"
                Value="{Binding RelativeSource={RelativeSource Self}, Path=Content, Mode=OneWay}" />
        <Setter Property="Height"
                Value="30" />
        <Setter Property="Padding"
                Value="10 7" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Height="{TemplateBinding Height}"
                          Width="{TemplateBinding Width}"
                          Background="Transparent"
                          IsHitTestVisible="True"
                          HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                          VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <Border x:Name="HighlightBackground"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Visibility="Hidden" />
                        <Border x:Name="HighlightBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="Transparent"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Visibility="Visible" />
                        <Border x:Name="DisabledBorder"
                                BorderBrush="{StaticResource Brush.Disabled}"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Visibility="Hidden" />
                        <Border x:Name="PressedBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderBrush="{StaticResource Brush.Focus}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Visibility="Hidden" />
                        <Grid x:Name="DisabledContent"
                              Margin="{TemplateBinding Padding}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{StaticResource Brush.Disabled}" />
                        </Grid>
                        <Grid x:Name="NormalContent"
                              Margin="{TemplateBinding Padding}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" />
                        </Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBackground"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content, Mode=OneWay}"
                               FontSize="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=FontSize, Mode=OneWay}"
                               Foreground="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Path=Foreground, Mode=OneWay}"
                               Style="{StaticResource TextBlock.Content}" />
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEnabled"
                     Value="False">
                <Setter Property="Foreground"
                        Value="{StaticResource Brush.Disabled}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="Button.Circle"
           TargetType="Button"
           BasedOn="{StaticResource Button.Classic}">
        <Setter Property="Height"
                Value="18" />
        <Setter Property="Width"
                Value="18" />
        <Setter Property="MinWidth"
                Value="0" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Foreground}" />
        <Setter Property="Padding"
                Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="Transparent"
                          IsHitTestVisible="True">
                        <Ellipse x:Name="Background"
                                 IsHitTestVisible="False"
                                 Width="{TemplateBinding Width}"
                                 Height="{TemplateBinding Height}"
                                 VerticalAlignment="Center"
                                 HorizontalAlignment="Center"
                                 Fill="{TemplateBinding Background}"
                                 Stroke="{TemplateBinding BorderBrush}"
                                 StrokeThickness="{TemplateBinding BorderThickness}"
                                 Visibility="Collapsed" />
                        <ContentPresenter VerticalAlignment="Center"
                                          HorizontalAlignment="Center"
                                          IsHitTestVisible="False"
                                          Margin="{TemplateBinding Padding}" />
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background"
                                                                       Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0.0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver"
                     Value="True">
                <Setter Property="Foreground"
                        Value="{StaticResource Brush.Accent}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="Button.ListItem"
           TargetType="Button">
        <Setter Property="MinWidth"
                Value="150" />
        <Setter Property="HorizontalAlignment"
                Value="Stretch" />
        <Setter Property="HorizontalContentAlignment"
                Value="Stretch" />
        <Setter Property="VerticalAlignment"
                Value="Stretch" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />
        <Setter Property="RenderOptions.ClearTypeHint"
                Value="Enabled" />
        <Setter Property="Background"
                Value="{StaticResource Brush.Background.Strong}" />
        <Setter Property="BorderBrush"
                Value="{StaticResource Brush.Separator}" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="Height"
                Value="35" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="Padding"
                Value="5 0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Height="{TemplateBinding Height}"
                          Width="{TemplateBinding Width}"
                          Background="Transparent"
                          IsHitTestVisible="True"
                          HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                          VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <Border x:Name="HighlightBackground"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="Transparent"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Opacity="0"
                                Visibility="Visible" />
                        <Border x:Name="HighlightBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Opacity="0"
                                Visibility="Visible" />
                        <Border x:Name="DisabledBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Visibility="Hidden" />
                        <Border x:Name="PressedBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{StaticResource Brush.Separator.Strong}"
                                BorderThickness="1"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="Hidden" />
                        <Grid x:Name="DisabledContent"
                              Margin="{TemplateBinding Padding}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{StaticResource Brush.Disabled}" />
                        </Grid>
                        <Grid x:Name="NormalContent"
                              Margin="{TemplateBinding Padding}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" />
                        </Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Standard}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0"
                                                         Duration="{StaticResource Duration.Standard}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEnabled"
                     Value="False">
                <Setter Property="Foreground"
                        Value="{StaticResource Brush.Disabled}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="Button.ToolBar"
           TargetType="Button"
           BasedOn="{StaticResource Button.Classic}">
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="MinWidth"
                Value="0" />
        <Setter Property="MinHeight"
                Value="0" />
        <Setter Property="Width"
                Value="25" />
        <Setter Property="Height"
                Value="25" />
        <Setter Property="Margin"
                Value="{StaticResource Margin.Button.Toolbar}" />
        <Setter Property="Padding"
                Value="2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Height="{TemplateBinding Height}"
                          Width="{TemplateBinding Width}"
                          Background="Transparent"
                          IsHitTestVisible="True"
                          HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                          VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <Border x:Name="HighlightBackground"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderThickness="0"
                                Opacity="0"
                                Visibility="Visible" />
                        <Border x:Name="HighlightBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="Transparent"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Opacity="0"
                                Visibility="Visible" />
                        <Border x:Name="DisabledBorder"
                                BorderBrush="{StaticResource Brush.Disabled}"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderThickness="0"
                                CornerRadius="0"
                                Visibility="Hidden" />
                        <Border x:Name="PressedBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderBrush="{StaticResource Brush.Focus}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Visibility="Hidden" />
                        <Grid x:Name="DisabledContent"
                              Margin="{TemplateBinding Padding}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{StaticResource Brush.Disabled}" />
                        </Grid>
                        <Grid x:Name="NormalContent"
                              Margin="{TemplateBinding Padding}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" />
                        </Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0"
                                                         Duration="{StaticResource Duration.Fast}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="Button.TreeNode"
           TargetType="Button"
           BasedOn="{StaticResource Button.Classic}">
        <Setter Property="MinWidth"
                Value="150" />
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="Height"
                Value="25" />
        <Setter Property="Padding"
                Value="5 0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Height="{TemplateBinding Height}"
                          Width="{TemplateBinding Width}"
                          Background="Transparent"
                          IsHitTestVisible="True"
                          HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                          VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <Border x:Name="CheckedBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="Hidden" />
                        <Border x:Name="HighlightBackground"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Opacity="0"
                                Visibility="Visible" />
                        <Border x:Name="HighlightBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="Transparent"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Opacity="0"
                                Visibility="Visible" />
                        <Border x:Name="DisabledBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Visibility="Hidden" />
                        <Border x:Name="PressedBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{StaticResource Brush.Separator.Strong}"
                                BorderThickness="1"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="Hidden" />
                        <Grid x:Name="DisabledContent"
                              Margin="{TemplateBinding Padding}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{StaticResource Brush.Disabled}" />
                        </Grid>
                        <Grid x:Name="NormalContent"
                              Margin="{TemplateBinding Padding}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" />
                        </Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0"
                                                         Duration="{StaticResource Duration.Fast}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal"
                                DataContext="{Binding RelativeSource={RelativeSource AncestorType=Button}, Mode=OneTime}">
                        <ContentPresenter x:Name="ButtonContent"
                                          Content="{Binding Path=Content}" />
                    </StackPanel>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEnabled"
                     Value="False">
                <Setter Property="Foreground"
                        Value="{StaticResource Brush.Disabled}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="ToggleButton.Undefined"
           TargetType="ToggleButton">
        <Setter Property="Validation.ErrorTemplate"
                Value="{x:Null}" />
        <Setter Property="Cursor"
                Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid Background="Transparent"
                          IsHitTestVisible="True">
                        <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ToggleButton.Classic"
           TargetType="ToggleButton"
           BasedOn="{StaticResource ToggleButton.Undefined}">
        <Setter Property="HorizontalAlignment"
                Value="Stretch" />
        <Setter Property="HorizontalContentAlignment"
                Value="Stretch" />
        <Setter Property="VerticalAlignment"
                Value="Stretch" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />
        <Setter Property="RenderOptions.ClearTypeHint"
                Value="Enabled" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Accent}" />
        <Setter Property="Background"
                Value="{StaticResource Brush.Background.Strong}" />
        <Setter Property="BorderBrush"
                Value="{StaticResource Brush.Separator}" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="ToolTip"
                Value="{Binding RelativeSource={RelativeSource Self}, Path=Content, Mode=OneWay}" />
        <Setter Property="Height"
                Value="25" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="Padding"
                Value="5 0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid Height="{TemplateBinding Height}"
                          Width="{TemplateBinding Width}"
                          Background="Transparent"
                          IsHitTestVisible="True"
                          HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                          VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <Border x:Name="CheckedBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="Hidden" />
                        <Border x:Name="HighlightBackground"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Visibility="Hidden" />
                        <Border x:Name="HighlightBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="Transparent"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="Visible" />
                        <Border x:Name="DisabledBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Visibility="Hidden" />
                        <Border x:Name="PressedBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderBrush="{StaticResource Brush.Focus}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="Hidden" />
                        <Grid x:Name="DisabledContent"
                              Margin="{TemplateBinding Padding}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{StaticResource Brush.Disabled}" />
                        </Grid>
                        <Grid x:Name="NormalContent"
                              Margin="{TemplateBinding Padding}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" />
                        </Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBackground"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckedBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock Style="{StaticResource TextBlock.Content}"
                               Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content, Mode=OneWay}"
                               Foreground="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton}, Path=Foreground, Mode=OneWay}"
                               FontSize="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton}, Path=FontSize, Mode=OneWay}" />
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsChecked"
                     Value="True">
                <Setter Property="Foreground"
                        Value="{StaticResource Brush.Accent.Strong}" />
            </Trigger>
            <Trigger Property="IsEnabled"
                     Value="False">
                <Setter Property="Foreground"
                        Value="{StaticResource Brush.Disabled}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="ToggleButton.Circle"
           TargetType="ToggleButton"
           BasedOn="{StaticResource ToggleButton.Classic}">
        <Setter Property="Width"
                Value="18" />
        <Setter Property="Height"
                Value="18" />
        <Setter Property="Margin"
                Value="3" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Foreground.Strong}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid Height="{TemplateBinding Height}"
                          Width="{TemplateBinding Width}"
                          Background="Transparent"
                          IsHitTestVisible="True"
                          HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                          VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <Ellipse x:Name="CheckedBorder"
                                 VerticalAlignment="Stretch"
                                 HorizontalAlignment="Stretch"
                                 Fill="{TemplateBinding Background}"
                                 Stroke="{TemplateBinding BorderBrush}"
                                 StrokeThickness="{TemplateBinding BorderThickness}"
                                 SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                 Visibility="Hidden" />
                        <Ellipse x:Name="HighlightBackground"
                                 VerticalAlignment="Stretch"
                                 HorizontalAlignment="Stretch"
                                 Fill="{TemplateBinding Background}"
                                 StrokeThickness="0"
                                 Visibility="Hidden" />
                        <Ellipse x:Name="HighlightBorder"
                                 VerticalAlignment="Stretch"
                                 HorizontalAlignment="Stretch"
                                 Stroke="{TemplateBinding BorderBrush}"
                                 Fill="Transparent"
                                 StrokeThickness="{TemplateBinding BorderThickness}"
                                 SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                 Visibility="Hidden" />
                        <Ellipse x:Name="DisabledBorder"
                                 VerticalAlignment="Stretch"
                                 HorizontalAlignment="Stretch"
                                 StrokeThickness="{TemplateBinding BorderThickness}"
                                 Visibility="Hidden" />
                        <Ellipse x:Name="PressedBorder"
                                 VerticalAlignment="Stretch"
                                 HorizontalAlignment="Stretch"
                                 Stroke="{StaticResource Brush.Focus}"
                                 StrokeThickness="{TemplateBinding BorderThickness}"
                                 SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                 Visibility="Hidden" />
                        <Grid x:Name="DisabledContent"
                              Margin="{TemplateBinding Padding}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{StaticResource Brush.Disabled}" />
                        </Grid>
                        <Grid x:Name="NormalContent"
                              Margin="{TemplateBinding Padding}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" />
                        </Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBackground"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckedBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ToggleButton.TreeNode"
           TargetType="ToggleButton"
           BasedOn="{StaticResource ToggleButton.Undefined}">
        <Setter Property="MinWidth"
                Value="150" />
        <Setter Property="HorizontalAlignment"
                Value="Stretch" />
        <Setter Property="HorizontalContentAlignment"
                Value="Stretch" />
        <Setter Property="VerticalAlignment"
                Value="Stretch" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />
        <Setter Property="RenderOptions.ClearTypeHint"
                Value="Enabled" />
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="BorderBrush"
                Value="{StaticResource Brush.Separator}" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="Height"
                Value="25" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="Padding"
                Value="5 0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid Height="{TemplateBinding Height}"
                          Width="{TemplateBinding Width}"
                          Background="Transparent"
                          IsHitTestVisible="True"
                          HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                          VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <Border x:Name="CheckedBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="Hidden" />
                        <Border x:Name="HighlightBackground"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Opacity="0"
                                Visibility="Visible" />
                        <Border x:Name="HighlightBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="Transparent"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Opacity="0"
                                Visibility="Visible" />
                        <Border x:Name="DisabledBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Visibility="Hidden" />
                        <Border x:Name="PressedBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{StaticResource Brush.Separator.Strong}"
                                BorderThickness="1"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="Hidden" />
                        <Grid x:Name="DisabledContent"
                              Margin="{TemplateBinding Padding}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{StaticResource Brush.Disabled}" />
                        </Grid>
                        <Grid x:Name="NormalContent"
                              Margin="{TemplateBinding Padding}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" />
                        </Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0"
                                                         Duration="{StaticResource Duration.Fast}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal"
                                DataContext="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton}, Mode=OneTime}">
                        <Grid Width="16">
                            <Grid.Style>
                                <Style TargetType="FrameworkElement">
                                    <Setter Property="Visibility"
                                            Value="Hidden" />
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding Tag, Mode=OneWay}"
                                                     Value="True">
                                            <Setter Property="Visibility"
                                                    Value="Visible" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Grid.Style>
                            <Viewbox x:Name="Expander1"
                                     Stretch="Uniform"
                                     Width="7"
                                     Visibility="Hidden">
                                <Path Data="{StaticResource Geometry.ArrowHead.Down}"
                                      Fill="{StaticResource Brush.Separator.Strong}" />
                            </Viewbox>
                            <Viewbox x:Name="Expander2"
                                     Stretch="Uniform"
                                     Height="7">
                                <Path Data="{StaticResource Geometry.ArrowHead.Right}"
                                      Fill="{StaticResource Brush.Separator.Strong}" />
                            </Viewbox>
                        </Grid>
                        <ContentPresenter x:Name="ButtonContent"
                                          Content="{Binding Path=Content}" />
                    </StackPanel>
                    <DataTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton}, Path=IsChecked}"
                                     Value="True">
                            <DataTrigger.Setters>
                                <Setter TargetName="Expander1"
                                        Property="Visibility"
                                        Value="Visible" />
                                <Setter TargetName="Expander2"
                                        Property="Visibility"
                                        Value="Hidden" />
                            </DataTrigger.Setters>
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEnabled"
                     Value="False">
                <Setter Property="Foreground"
                        Value="{StaticResource Brush.Disabled}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="ToggleButton.ToolBar"
           TargetType="ToggleButton"
           BasedOn="{StaticResource ToggleButton.Classic}">
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="MinWidth"
                Value="0" />
        <Setter Property="MinHeight"
                Value="0" />
        <Setter Property="Width"
                Value="25" />
        <Setter Property="Height"
                Value="25" />
        <Setter Property="Margin"
                Value="{StaticResource Margin.Button.Toolbar}" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Foreground.Strong}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid Height="{TemplateBinding Height}"
                          Width="{TemplateBinding Width}"
                          Background="Transparent"
                          IsHitTestVisible="True"
                          HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                          VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <Border x:Name="CheckedBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="Hidden" />
                        <Border x:Name="HighlightBackground"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Opacity="0"
                                Visibility="Visible" />
                        <Border x:Name="HighlightBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="Transparent"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Opacity="0"
                                Visibility="Visible" />
                        <Border x:Name="DisabledBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="0"
                                Visibility="Hidden" />
                        <Border x:Name="PressedBorder"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{StaticResource Brush.Separator.Strong}"
                                BorderThickness="1"
                                CornerRadius="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="Hidden" />
                        <Grid x:Name="DisabledContent"
                              Margin="{TemplateBinding Padding}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{StaticResource Brush.Disabled}" />
                        </Grid>
                        <Grid x:Name="NormalContent"
                              Margin="{TemplateBinding Padding}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" />
                        </Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0"
                                                         Duration="{StaticResource Duration.Fast}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <DoubleAnimation Storyboard.TargetName="HighlightBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="{StaticResource Duration.Fast}" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledBorder"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalContent"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0%">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Hidden</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- TextBox-->
    <Style x:Key="TextBox.Classic"
           TargetType="{x:Type TextBox}">
        <Setter Property="Margin"
                Value="0" />
        <Setter Property="Padding"
                Value="2 3" />
        <Setter Property="Background"
                Value="{StaticResource Brush.Background.Strong}" />
        <Setter Property="BorderBrush"
                Value="{StaticResource Brush.Separator}" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Foreground.Strong}" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="SelectionBrush"
                Value="{StaticResource Brush.Accent.Strong}" />
        <Setter Property="CaretBrush"
                Value="{StaticResource Brush.Foreground}" />
        <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="FontFamily"
                Value="Segoe UI" />
        <Setter Property="FontSize"
                Value="{StaticResource Font.Size.Larger}" />
        <Setter Property="VerticalAlignment"
                Value="Stretch" />
        <Setter Property="VerticalContentAlignment"
                Value="Top" />
        <Setter Property="TextOptions.TextFormattingMode"
                Value="Display" />
        <Setter Property="TextOptions.TextRenderingMode"
                Value="ClearType" />
        <Setter Property="TextOptions.TextHintingMode"
                Value="Fixed" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Grid Background="Transparent"
                          IsHitTestVisible="True">
                        <Border x:Name="focusBorder"
                                Background="{TemplateBinding Background}"
                                IsHitTestVisible="False"
                                CornerRadius="0"
                                Visibility="Hidden"
                                Effect="{StaticResource Shadow.Focus}" />
                        <Border x:Name="border"
                                BorderBrush="{x:Null}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="0"
                                SnapsToDevicePixels="True">
                            <Grid>
                                <ScrollViewer x:Name="PART_ContentHost"
                                              Background="Transparent"
                                              IsHitTestVisible="False"
                                              Margin="{TemplateBinding Padding}"
                                              HorizontalAlignment="Stretch"
                                              VerticalAlignment="Stretch"
                                              HorizontalScrollBarVisibility="Hidden"
                                              VerticalScrollBarVisibility="Hidden" />
                            </Grid>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled"
                                 Value="false">
                            <Setter Property="Opacity"
                                    TargetName="border"
                                    Value="0.56" />
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused"
                                 Value="true">
                            <Setter Property="BorderBrush"
                                    TargetName="border"
                                    Value="{StaticResource Brush.Black}" />
                            <Setter Property="Visibility"
                                    TargetName="focusBorder"
                                    Value="Visible" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="TextBox.Undefined"
           TargetType="TextBox"
           BasedOn="{StaticResource TextBox.Classic}">
        <Setter Property="FontSize"
                Value="{StaticResource Font.Size.Normal}" />
        <Setter Property="Padding"
                Value="1 3" />
        <Setter Property="Validation.ErrorTemplate"
                Value="{StaticResource Validation.ErrorTemplate.Mini}" />
        <Setter Property="Background"
                Value="{x:Null}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <Grid x:Name="Root">
                        <ScrollViewer x:Name="PART_ContentHost"
                                      Background="{TemplateBinding Background}"
                                      Margin="{TemplateBinding Padding}"
                                      Padding="0"
                                      Focusable="false"
                                      HorizontalScrollBarVisibility="Hidden"
                                      VerticalScrollBarVisibility="Hidden" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled"
                                 Value="false">
                            <Setter Property="Opacity"
                                    TargetName="Root"
                                    Value="0.56" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- PasswordBox -->
    <Style x:Key="PasswordBox.Classic"
           TargetType="{x:Type PasswordBox}">
        <Setter Property="Margin"
                Value="0" />
        <Setter Property="Padding"
                Value="2 3" />
        <Setter Property="Background"
                Value="{StaticResource Brush.Background.Strong}" />
        <Setter Property="BorderBrush"
                Value="{StaticResource Brush.Separator}" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Foreground.Strong}" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="SelectionBrush"
                Value="{StaticResource Brush.Accent.Strong}" />
        <Setter Property="CaretBrush"
                Value="{StaticResource Brush.Foreground}" />
        <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="FontFamily"
                Value="Segoe UI" />
        <Setter Property="FontSize"
                Value="{StaticResource Font.Size.Larger}" />
        <Setter Property="VerticalAlignment"
                Value="Stretch" />
        <Setter Property="VerticalContentAlignment"
                Value="Top" />
        <Setter Property="TextOptions.TextFormattingMode"
                Value="Display" />
        <Setter Property="TextOptions.TextRenderingMode"
                Value="ClearType" />
        <Setter Property="TextOptions.TextHintingMode"
                Value="Fixed" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="PasswordChar"
                Value="*" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <Grid Background="Transparent"
                          IsHitTestVisible="True">
                        <Border x:Name="focusBorder"
                                Background="{TemplateBinding Background}"
                                IsHitTestVisible="False"
                                CornerRadius="0"
                                Visibility="Hidden"
                                Effect="{StaticResource Shadow.Focus}" />
                        <Border x:Name="border"
                                BorderBrush="{x:Null}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="0"
                                SnapsToDevicePixels="True">
                            <Grid>
                                <ScrollViewer x:Name="PART_ContentHost"
                                              Background="Transparent"
                                              IsHitTestVisible="False"
                                              Margin="{TemplateBinding Padding}"
                                              HorizontalAlignment="Stretch"
                                              VerticalAlignment="Stretch"
                                              HorizontalScrollBarVisibility="Hidden"
                                              VerticalScrollBarVisibility="Hidden" />
                            </Grid>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled"
                                 Value="false">
                            <Setter Property="Opacity"
                                    TargetName="border"
                                    Value="0.56" />
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused"
                                 Value="true">
                            <Setter Property="BorderBrush"
                                    TargetName="border"
                                    Value="{StaticResource Brush.Black}" />
                            <Setter Property="Visibility"
                                    TargetName="focusBorder"
                                    Value="Visible" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- ProgressBar -->
    <Style x:Key="ProgressBar.Classic"
           TargetType="{x:Type ProgressBar}">
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Accent}" />
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="BorderBrush"
                Value="{StaticResource Brush.Separator}" />
        <Setter Property="BorderThickness"
                Value="0" />
        <Setter Property="Height"
                Value="2" />
        <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.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"
                                                                       Storyboard.TargetName="Animation">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="0.25" />
                                            <EasingDoubleKeyFrame KeyTime="0:0:1.5"
                                                                  Value="0.25" />
                                            <EasingDoubleKeyFrame KeyTime="0:0:3"
                                                                  Value="0.25" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)"
                                                                      Storyboard.TargetName="Animation">
                                            <EasingPointKeyFrame KeyTime="0"
                                                                 Value="-0.5,0.5" />
                                            <EasingPointKeyFrame KeyTime="0:0:1.5"
                                                                 Value="0.5,0.5" />
                                            <EasingPointKeyFrame KeyTime="0:0:3"
                                                                 Value="1.5,0.5" />
                                        </PointAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}" />
                        <Rectangle x:Name="PART_Track" />
                        <Grid x:Name="PART_Indicator"
                              ClipToBounds="true"
                              HorizontalAlignment="Left">
                            <Rectangle x:Name="Indicator"
                                       Fill="{TemplateBinding Foreground}" />
                            <Rectangle x:Name="Animation"
                                       Fill="{TemplateBinding Foreground}"
                                       RenderTransformOrigin="0.5,0.5">
                                <Rectangle.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform />
                                        <SkewTransform />
                                        <RotateTransform />
                                        <TranslateTransform />
                                    </TransformGroup>
                                </Rectangle.RenderTransform>
                            </Rectangle>
                        </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="Indicator"
                                    Value="Collapsed" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--==ScrollViewer==-->
    <Style x:Key="ScrollBar.Classic"
           TargetType="ScrollBar">
        <Setter Property="OverridesDefaultStyle"
                Value="True" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Separator}" />
        <Setter Property="Background"
                Value="{StaticResource Brush.Background}" />
        <Setter Property="IsTabStop"
                Value="False" />
        <Style.Triggers>
            <Trigger Property="Orientation"
                     Value="Horizontal">
                <Setter Property="Width"
                        Value="Auto" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ScrollBar">
                            <ControlTemplate.Resources>
                                <ControlTemplate x:Key="RepeatButtonTemplate"
                                                 TargetType="RepeatButton">
                                    <Grid x:Name="Root"
                                          Background="Transparent"
                                          IsHitTestVisible="True" />
                                </ControlTemplate>
                                <ControlTemplate x:Key="ArrowRepeatButtonTemplate"
                                                 TargetType="RepeatButton">
                                    <Grid x:Name="Root"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          Background="{TemplateBinding Background}">
                                        <Viewbox Stretch="Uniform"
                                                 Margin="0 1">
                                            <Path Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z "
                                                  Stretch="Uniform"
                                                  Fill="{TemplateBinding Foreground}" />
                                        </Viewbox>
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="HorizontalThumbTemplate"
                                                 TargetType="Thumb">
                                    <Rectangle Fill="{TemplateBinding Foreground}" />
                                </ControlTemplate>
                                <Style x:Key="ArrowRepeatButtonStyle"
                                       TargetType="RepeatButton"
                                       BasedOn="{StaticResource {x:Type RepeatButton}}">
                                    <Setter Property="Opacity"
                                            Value="1" />
                                    <Setter Property="Height"
                                            Value="8" />
                                    <Setter Property="Width"
                                            Value="15" />
                                    <Setter Property="Interval"
                                            Value="50" />
                                    <Setter Property="IsTabStop"
                                            Value="False" />
                                    <Setter Property="Margin"
                                            Value="0" />
                                    <Setter Property="VerticalAlignment"
                                            Value="Center" />
                                    <Setter Property="HorizontalContentAlignment"
                                            Value="Stretch" />
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Path=IsMouseOver}"
                                                     Value="False">
                                            <Setter Property="Opacity"
                                                    Value="0" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </ControlTemplate.Resources>
                            <Grid x:Name="Root">
                                <Grid x:Name="HorizontalRoot"
                                      Height="8"
                                      Background="Transparent">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Rectangle Name="Background"
                                               Fill="{TemplateBinding Background}"
                                               Grid.Column="1"
                                               VerticalAlignment="Bottom"
                                               HorizontalAlignment="Stretch"
                                               Visibility="{Binding ElementName=PART_Track, Path=Visibility}">
                                        <Rectangle.Style>
                                            <Style TargetType="Rectangle">
                                                <Setter Property="Opacity"
                                                        Value="0.1" />
                                                <Setter Property="Height"
                                                        Value="8" />
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Path=IsMouseOver}"
                                                                 Value="False">
                                                        <DataTrigger.EnterActions>
                                                            <BeginStoryboard>
                                                                <Storyboard>
                                                                    <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                                                                     To="0" />
                                                                </Storyboard>
                                                            </BeginStoryboard>
                                                        </DataTrigger.EnterActions>
                                                        <DataTrigger.ExitActions>
                                                            <BeginStoryboard>
                                                                <Storyboard>
                                                                    <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                                                                     To="0" />
                                                                </Storyboard>
                                                            </BeginStoryboard>
                                                        </DataTrigger.ExitActions>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Rectangle.Style>
                                    </Rectangle>
                                    <RepeatButton x:Name="HorizontalSmallDecrease"
                                                  Style="{StaticResource ArrowRepeatButtonStyle}"
                                                  Grid.Column="0"
                                                  Template="{StaticResource ArrowRepeatButtonTemplate}"
                                                  Background="{TemplateBinding Background}"
                                                  Foreground="{TemplateBinding Foreground}"
                                                  Command="ScrollBar.LineLeftCommand"
                                                  Visibility="{Binding ElementName=PART_Track, Path=Visibility}"
                                                  RenderTransformOrigin="0.5 0.5">
                                        <RepeatButton.RenderTransform>
                                            <RotateTransform Angle="180" />
                                        </RepeatButton.RenderTransform>
                                    </RepeatButton>
                                    <Track x:Name="PART_Track"
                                           Grid.Column="1"
                                           Margin="0"
                                           Orientation="Horizontal">
                                        <Track.DecreaseRepeatButton>
                                            <RepeatButton x:Name="HorizontalLargeDecrease"
                                                          IsTabStop="False"
                                                          Interval="50"
                                                          Template="{StaticResource RepeatButtonTemplate}"
                                                          Command="ScrollBar.PageLeftCommand" />
                                        </Track.DecreaseRepeatButton>
                                        <Track.Thumb>
                                            <Thumb x:Name="HorizontalThumb"
                                                   Width="Auto"
                                                   MinWidth="18"
                                                   Background="{TemplateBinding Background}"
                                                   Foreground="{TemplateBinding Foreground}"
                                                   Template="{StaticResource HorizontalThumbTemplate}"
                                                   HorizontalAlignment="Stretch"
                                                   VerticalAlignment="Bottom">
                                                <Thumb.Style>
                                                    <Style TargetType="Thumb"
                                                           BasedOn="{StaticResource {x:Type Thumb}}">
                                                        <Setter Property="Opacity"
                                                                Value="1" />
                                                        <Setter Property="Height"
                                                                Value="8" />
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Path=IsMouseOver}"
                                                                         Value="False">
                                                                <DataTrigger.EnterActions>
                                                                    <BeginStoryboard>
                                                                        <Storyboard>
                                                                            <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                                                                             Duration="0:0:0.3"
                                                                                             To="0" />
                                                                        </Storyboard>
                                                                    </BeginStoryboard>
                                                                </DataTrigger.EnterActions>
                                                                <DataTrigger.ExitActions>
                                                                    <BeginStoryboard>
                                                                        <Storyboard>
                                                                            <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                                                                             Duration="0:0:0.3"
                                                                                             To="1" />
                                                                        </Storyboard>
                                                                    </BeginStoryboard>
                                                                </DataTrigger.ExitActions>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </Thumb.Style>
                                            </Thumb>
                                        </Track.Thumb>
                                        <Track.IncreaseRepeatButton>
                                            <RepeatButton x:Name="HorizontalLargeIncrease"
                                                          IsTabStop="False"
                                                          Interval="50"
                                                          Template="{StaticResource RepeatButtonTemplate}"
                                                          Command="ScrollBar.PageRightCommand" />
                                        </Track.IncreaseRepeatButton>
                                    </Track>
                                    <RepeatButton x:Name="HorizontalSmallIncrease"
                                                  Grid.Column="2"
                                                  Style="{StaticResource ArrowRepeatButtonStyle}"
                                                  Background="{TemplateBinding Background}"
                                                  Foreground="{TemplateBinding Foreground}"
                                                  Template="{StaticResource ArrowRepeatButtonTemplate}"
                                                  Command="ScrollBar.LineRightCommand"
                                                  Visibility="{Binding ElementName=PART_Track, Path=Visibility}"></RepeatButton>
                                </Grid>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Orientation"
                     Value="Vertical">
                <Setter Property="Height"
                        Value="Auto" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ScrollBar">
                            <ControlTemplate.Resources>
                                <ControlTemplate x:Key="RepeatButtonTemplate"
                                                 TargetType="RepeatButton">
                                    <Grid x:Name="Root"
                                          Background="Transparent"
                                          IsHitTestVisible="True" />
                                </ControlTemplate>
                                <ControlTemplate x:Key="ArrowRepeatButtonTemplate"
                                                 TargetType="RepeatButton">
                                    <Grid x:Name="Root"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          Background="{TemplateBinding Background}">
                                        <Viewbox Stretch="Uniform"
                                                 Margin="1 0"
                                                 HorizontalAlignment="Stretch"
                                                 VerticalAlignment="Stretch">
                                            <Path Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "
                                                  Stretch="Uniform"
                                                  Fill="{TemplateBinding Foreground}" />
                                        </Viewbox>
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="VerticalThumbTemplate"
                                                 TargetType="Thumb">
                                    <Rectangle x:Name="Background"
                                               Fill="{TemplateBinding Foreground}" />
                                </ControlTemplate>
                                <Style x:Key="ArrowRepeatButtonStyle"
                                       TargetType="RepeatButton"
                                       BasedOn="{StaticResource {x:Type RepeatButton}}">
                                    <Setter Property="Opacity"
                                            Value="1" />
                                    <Setter Property="Width"
                                            Value="8" />
                                    <Setter Property="Height"
                                            Value="15" />
                                    <Setter Property="IsTabStop"
                                            Value="False" />
                                    <Setter Property="Interval"
                                            Value="50" />
                                    <Setter Property="Margin"
                                            Value="0" />
                                    <Setter Property="HorizontalAlignment"
                                            Value="Right" />
                                    <Setter Property="VerticalContentAlignment"
                                            Value="Stretch" />
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Path=IsMouseOver}"
                                                     Value="False">
                                            <DataTrigger.EnterActions>
                                                <BeginStoryboard>
                                                    <Storyboard>
                                                        <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                                                         Duration="0:0:0.3"
                                                                         To="0" />
                                                    </Storyboard>
                                                </BeginStoryboard>
                                            </DataTrigger.EnterActions>
                                            <DataTrigger.ExitActions>
                                                <BeginStoryboard>
                                                    <Storyboard>
                                                        <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                                                         Duration="0:0:0.3"
                                                                         To="1" />
                                                    </Storyboard>
                                                </BeginStoryboard>
                                            </DataTrigger.ExitActions>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </ControlTemplate.Resources>
                            <Grid x:Name="Root">
                                <vsm:VisualStateManager.VisualStateGroups>
                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                        <vsm:VisualState x:Name="Normal" />
                                        <vsm:VisualState x:Name="MouseOver" />
                                        <vsm:VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                               Storyboard.TargetName="Root">
                                                    <SplineDoubleKeyFrame KeyTime="0"
                                                                          Value="0.5" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                    </vsm:VisualStateGroup>
                                </vsm:VisualStateManager.VisualStateGroups>
                                <Grid x:Name="VerticalRoot"
                                      Width="8"
                                      Background="Transparent">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="*" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <Rectangle Name="Background"
                                               Fill="{TemplateBinding Background}"
                                               Grid.Row="1"
                                               VerticalAlignment="Stretch"
                                               HorizontalAlignment="Right"
                                               Visibility="{Binding ElementName=PART_Track, Path=Visibility}">
                                        <Rectangle.Style>
                                            <Style TargetType="Rectangle">
                                                <Setter Property="Opacity"
                                                        Value="0.1" />
                                                <Setter Property="Width"
                                                        Value="8" />
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Path=IsMouseOver}"
                                                                 Value="False">
                                                        <DataTrigger.EnterActions>
                                                            <BeginStoryboard>
                                                                <Storyboard>
                                                                    <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                                                                     Duration="0:0:0.3"
                                                                                     To="0" />
                                                                </Storyboard>
                                                            </BeginStoryboard>
                                                        </DataTrigger.EnterActions>
                                                        <DataTrigger.ExitActions>
                                                            <BeginStoryboard>
                                                                <Storyboard>
                                                                    <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                                                                     Duration="0:0:0.3"
                                                                                     To="1" />
                                                                </Storyboard>
                                                            </BeginStoryboard>
                                                        </DataTrigger.ExitActions>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Rectangle.Style>
                                    </Rectangle>
                                    <RepeatButton x:Name="VerticalSmallDecrease"
                                                  Style="{StaticResource ArrowRepeatButtonStyle}"
                                                  Grid.Row="0"
                                                  Background="{TemplateBinding Background}"
                                                  Foreground="{TemplateBinding Foreground}"
                                                  Visibility="{Binding ElementName=PART_Track, Path=Visibility}"
                                                  Template="{StaticResource ArrowRepeatButtonTemplate}"
                                                  Command="ScrollBar.LineUpCommand"
                                                  RenderTransformOrigin="0.5 0.5">
                                        <RepeatButton.RenderTransform>
                                            <RotateTransform Angle="180" />
                                        </RepeatButton.RenderTransform>
                                    </RepeatButton>
                                    <Track x:Name="PART_Track"
                                           Grid.Row="1"
                                           Margin="0"
                                           IsDirectionReversed="True"
                                           Orientation="Vertical">
                                        <Track.DecreaseRepeatButton>
                                            <RepeatButton x:Name="VerticalLargeDecrease"
                                                          Interval="50"
                                                          IsTabStop="False"
                                                          Template="{StaticResource RepeatButtonTemplate}"
                                                          Command="ScrollBar.PageUpCommand" />
                                        </Track.DecreaseRepeatButton>
                                        <Track.Thumb>
                                            <Thumb x:Name="VerticalThumb"
                                                   Height="Auto"
                                                   MinHeight="18"
                                                   Foreground="{TemplateBinding Foreground}"
                                                   Template="{StaticResource VerticalThumbTemplate}"
                                                   VerticalAlignment="Stretch"
                                                   HorizontalAlignment="Right">
                                                <Thumb.Style>
                                                    <Style TargetType="Thumb"
                                                           BasedOn="{StaticResource {x:Type Thumb}}">
                                                        <Setter Property="Width"
                                                                Value="8" />
                                                        <Setter Property="Opacity"
                                                                Value="1" />
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}, Path=IsMouseOver}"
                                                                         Value="False">
                                                                <DataTrigger.EnterActions>
                                                                    <BeginStoryboard>
                                                                        <Storyboard>
                                                                            <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                                                                             Duration="0:0:0.3"
                                                                                             To="0" />
                                                                        </Storyboard>
                                                                    </BeginStoryboard>
                                                                </DataTrigger.EnterActions>
                                                                <DataTrigger.ExitActions>
                                                                    <BeginStoryboard>
                                                                        <Storyboard>
                                                                            <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                                                                             Duration="0:0:0.3"
                                                                                             To="1" />
                                                                        </Storyboard>
                                                                    </BeginStoryboard>
                                                                </DataTrigger.ExitActions>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </Thumb.Style>
                                            </Thumb>
                                        </Track.Thumb>
                                        <Track.IncreaseRepeatButton>
                                            <RepeatButton x:Name="VerticalLargeIncrease"
                                                          IsTabStop="False"
                                                          Interval="50"
                                                          Template="{StaticResource RepeatButtonTemplate}"
                                                          Command="ScrollBar.PageDownCommand" />
                                        </Track.IncreaseRepeatButton>
                                    </Track>
                                    <RepeatButton x:Name="VerticalSmallIncrease"
                                                  Style="{StaticResource ArrowRepeatButtonStyle}"
                                                  Grid.Row="2"
                                                  Background="{TemplateBinding Background}"
                                                  Foreground="{TemplateBinding Foreground}"
                                                  Template="{StaticResource ArrowRepeatButtonTemplate}"
                                                  Command="ScrollBar.LineDownCommand"
                                                  Visibility="{Binding ElementName=PART_Track, Path=Visibility}" />
                                </Grid>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="ScrollViewer.Classic"
           TargetType="ScrollViewer">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Foreground}" />
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="HorizontalContentAlignment"
                Value="Left" />
        <Setter Property="VerticalContentAlignment"
                Value="Top" />
        <Setter Property="VerticalScrollBarVisibility"
                Value="Visible" />
        <Setter Property="Padding"
                Value="0" />
        <Setter Property="Margin"
                Value="0" />
        <Setter Property="BorderThickness"
                Value="0" />
        <Setter Property="FocusVisualStyle"
                Value="{x:Null}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollViewer">
                    <!--ScrollViewer template must not account for Padding value, because textBox internaly overrides Padding value, even if overriden in TextBox style-->
                    <!--"https://stackoverflow.com/questions/16424739/textbox-template-padding-issue"-->
                    <Grid Background="{TemplateBinding Background}">
                        <ScrollContentPresenter x:Name="ScrollContentPresenter"
                                                Cursor="{TemplateBinding Cursor}"
                                                Margin="0"
                                                Content="{TemplateBinding Content}"
                                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                                CanContentScroll="{TemplateBinding CanContentScroll}"
                                                FocusVisualStyle="{x:Null}" />
                        <ScrollBar x:Name="PART_VerticalScrollBar"
                                   Style="{StaticResource ScrollBar.Classic}"
                                   IsTabStop="False"
                                   Maximum="{TemplateBinding ScrollableHeight}"
                                   Margin="0"
                                   Minimum="0"
                                   Orientation="Vertical"
                                   Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                                   Value="{TemplateBinding VerticalOffset}"
                                   ViewportSize="{TemplateBinding ViewportHeight}"
                                   HorizontalAlignment="Right" />
                        <ScrollBar x:Name="PART_HorizontalScrollBar"
                                   Style="{StaticResource ScrollBar.Classic}"
                                   IsTabStop="False"
                                   Maximum="{TemplateBinding ScrollableWidth}"
                                   Margin="0"
                                   Minimum="0"
                                   Orientation="Horizontal"
                                   Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                                   Value="{TemplateBinding HorizontalOffset}"
                                   ViewportSize="{TemplateBinding ViewportWidth}"
                                   VerticalAlignment="Bottom" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="UserControl.Dialog"
           TargetType="UserControl">
        <Setter Property="MinWidth"
                Value="500" />
        <Setter Property="MinHeight"
                Value="300" />
        <Setter Property="MaxWidth"
                Value="800" />
        <Setter Property="MaxHeight"
                Value="500" />
    </Style>
    <Style x:Key="ContentControl.Dialog"
           TargetType="ContentControl">
        <Setter Property="Visibility"
                Value="Collapsed" />
        <Setter Property="Opacity"
                Value="0" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"
                         Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                             To="1"
                                             Duration="{StaticResource Duration.Fast}" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0%">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                             To="0"
                                             Duration="{StaticResource Duration.Fast}" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                           Duration="{StaticResource Duration.Fast}">
                                <DiscreteObjectKeyFrame KeyTime="100%">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.ExitActions>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="Border.Overlay"
           TargetType="Border">
        <Setter Property="Visibility"
                Value="Collapsed" />
        <Setter Property="Opacity"
                Value="0" />
        <Setter Property="Background"
                Value="{StaticResource Brush.Black}" />
        <Setter Property="IsHitTestVisible"
                Value="True" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"
                         Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                             To="0.15"
                                             Duration="{StaticResource Duration.Fast}" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0%">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                             To="0"
                                             Duration="{StaticResource Duration.Fast}" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                           Duration="{StaticResource Duration.Fast}">
                                <DiscreteObjectKeyFrame KeyTime="100%">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.ExitActions>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <!-- TabControl -->
    <Style x:Key="TabItem.Classic.Top"
           TargetType="TabItem">
        <Setter Property="FocusVisualStyle"
                Value="{x:Null}" />
        <Setter Property="Cursor"
                Value="Hand" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Accent}" />
        <Setter Property="Background"
                Value="{StaticResource Brush.Background}" />
        <Setter Property="BorderBrush"
                Value="{StaticResource Brush.Separator.Strong}" />
        <Setter Property="BorderThickness"
                Value="0" />
        <Setter Property="Margin"
                Value="0 0 0 0" />
        <Setter Property="Padding"
                Value="10 5" />
        <Setter Property="Height"
                Value="30" />
        <Setter Property="HorizontalContentAlignment"
                Value="Stretch" />
        <Setter Property="VerticalContentAlignment"
                Value="Stretch" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock Text="{Binding}"
                               Style="{StaticResource TextBlock.Content}"
                               HorizontalAlignment="Left"
                               VerticalAlignment="Center"
                               Foreground="{Binding RelativeSource={RelativeSource AncestorType=TabItem}, Path=Foreground, Mode=OneWay}" />
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TabItem">
                    <Grid x:Name="TemplateRoot"
                          Background="Transparent"
                          SnapsToDevicePixels="true">
                        <Border x:Name="SelectedBorder"
                                Background="{Binding ElementName=Border, Path=Background, Mode=OneWay}"
                                Margin="1 1 1 -1"
                                Visibility="Collapsed"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        <Border x:Name="Border"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                Margin="0" />
                        <ContentPresenter x:Name="contentPresenter"
                                          ContentSource="Header"
                                          Focusable="False"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          Margin="{TemplateBinding Padding}"
                                          RecognizesAccessKey="True"
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}"
                                     Value="false">
                            <Setter Property="Opacity"
                                    TargetName="contentPresenter"
                                    Value="0.56" />
                            <Setter Property="BorderBrush"
                                    TargetName="Border"
                                    Value="{StaticResource Brush.Disabled}" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}"
                                     Value="true">
                            <Setter Property="Margin"
                                    Value="0 0 0 0" />
                            <Setter TargetName="Border"
                                    Property="Background"
                                    Value="{StaticResource Brush.Background.Strong}" />
                            <Setter TargetName="SelectedBorder"
                                    Property="Visibility"
                                    Value="Visible" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsSelected, Mode=OneWay}"
                                     Value="False">
                            <Setter TargetName="Border"
                                    Property="BorderThickness"
                                    Value="0" />
                            <Setter Property="Foreground"
                                    Value="{StaticResource Brush.Foreground}" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="TabControl.Classic"
           TargetType="{x:Type TabControl}">
        <Setter Property="Padding"
                Value="0" />
        <Setter Property="HorizontalContentAlignment"
                Value="Center" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />
        <Setter Property="Background"
                Value="{StaticResource Brush.Background}" />
        <Setter Property="BorderBrush"
                Value="{StaticResource Brush.Background.Strong}" />
        <Setter Property="Foreground"
                Value="{StaticResource Brush.Foreground}" />
        <Setter Property="TabStripPlacement"
                Value="Top" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TabControl">
                    <Grid x:Name="templateRoot"
                          ClipToBounds="true"
                          SnapsToDevicePixels="true"
                          KeyboardNavigation.TabNavigation="Local">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition x:Name="ColumnDefinition0" />
                            <ColumnDefinition x:Name="ColumnDefinition1"
                                              Width="0" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition x:Name="RowDefinition0"
                                           Height="Auto" />
                            <RowDefinition x:Name="RowDefinition1"
                                           Height="*" />
                        </Grid.RowDefinitions>
                        <TabPanel x:Name="headerPanel"
                                  Grid.Column="0"
                                  IsItemsHost="true"
                                  Margin="0"
                                  Background="{TemplateBinding Background}"
                                  Grid.Row="0"
                                  KeyboardNavigation.TabIndex="1"
                                  Panel.ZIndex="1" />
                        <Border x:Name="contentPanel"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{StaticResource Brush.Background}"
                                Grid.Column="0"
                                KeyboardNavigation.DirectionalNavigation="Contained"
                                Grid.Row="1"
                                KeyboardNavigation.TabIndex="2"
                                KeyboardNavigation.TabNavigation="Local">
                            <ContentPresenter x:Name="PART_SelectedContentHost"
                                              ContentSource="SelectedContent"
                                              Margin="{TemplateBinding Padding}"
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="TabStripPlacement"
                                 Value="Bottom">
                            <Setter Property="Grid.Row"
                                    TargetName="headerPanel"
                                    Value="1" />
                            <Setter Property="Grid.Row"
                                    TargetName="contentPanel"
                                    Value="0" />
                            <Setter Property="Height"
                                    TargetName="RowDefinition0"
                                    Value="*" />
                            <Setter Property="Height"
                                    TargetName="RowDefinition1"
                                    Value="Auto" />
                        </Trigger>
                        <Trigger Property="TabStripPlacement"
                                 Value="Left">
                            <Setter Property="Grid.Row"
                                    TargetName="headerPanel"
                                    Value="0" />
                            <Setter Property="Grid.Row"
                                    TargetName="contentPanel"
                                    Value="0" />
                            <Setter Property="Grid.Column"
                                    TargetName="headerPanel"
                                    Value="0" />
                            <Setter Property="Grid.Column"
                                    TargetName="contentPanel"
                                    Value="1" />
                            <Setter Property="Width"
                                    TargetName="ColumnDefinition0"
                                    Value="Auto" />
                            <Setter Property="Width"
                                    TargetName="ColumnDefinition1"
                                    Value="*" />
                            <Setter Property="Height"
                                    TargetName="RowDefinition0"
                                    Value="*" />
                            <Setter Property="Height"
                                    TargetName="RowDefinition1"
                                    Value="0" />
                        </Trigger>
                        <Trigger Property="TabStripPlacement"
                                 Value="Right">
                            <Setter Property="Grid.Row"
                                    TargetName="headerPanel"
                                    Value="0" />
                            <Setter Property="Grid.Row"
                                    TargetName="contentPanel"
                                    Value="0" />
                            <Setter Property="Grid.Column"
                                    TargetName="headerPanel"
                                    Value="1" />
                            <Setter Property="Grid.Column"
                                    TargetName="contentPanel"
                                    Value="0" />
                            <Setter Property="Width"
                                    TargetName="ColumnDefinition0"
                                    Value="*" />
                            <Setter Property="Width"
                                    TargetName="ColumnDefinition1"
                                    Value="Auto" />
                            <Setter Property="Height"
                                    TargetName="RowDefinition0"
                                    Value="*" />
                            <Setter Property="Height"
                                    TargetName="RowDefinition1"
                                    Value="0" />
                        </Trigger>
                        <Trigger Property="IsEnabled"
                                 Value="false">
                            <Setter Property="TextElement.Foreground"
                                    TargetName="templateRoot"
                                    Value="{StaticResource Brush.Disabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="TabStripPlacement"
                     Value="Top">
                <Setter Property="ItemContainerStyle"
                        Value="{StaticResource TabItem.Classic.Top}" />
                <Setter Property="BorderThickness"
                        Value="0 1 0 0" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <!-- default styles for components that have only one style in the application -->
    <Style TargetType="ScrollBar"
           BasedOn="{StaticResource ScrollBar.Classic}" />
    <Style TargetType="ScrollViewer"
           BasedOn="{StaticResource ScrollViewer.Classic}" />
    <Style TargetType="ListBox">
        <!--no special styles defined for listbox (just correct default style a bit) -->
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="ListBoxItem">
                    <Setter Property="Height"
                            Value="auto" />
                    <Setter Property="HorizontalContentAlignment"
                            Value="Stretch" />
                    <Setter Property="VerticalContentAlignment"
                            Value="Stretch" />
                    <Setter Property="Padding"
                            Value="2" />
                    <Setter Property="Foreground"
                            Value="{StaticResource Brush.Foreground}" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ListBoxItem">
                                <Grid>
                                    <vsm:VisualStateManager.VisualStateGroups>
                                        <vsm:VisualStateGroup x:Name="CommonStates">
                                            <vsm:VisualState x:Name="Normal" />
                                            <vsm:VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverRectangle"
                                                                                   Storyboard.TargetProperty="Visibility"
                                                                                   Duration="0:0:0.0">
                                                        <DiscreteObjectKeyFrame KeyTime="0%">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <Visibility>Visible</Visibility>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="Disabled" />
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="SelectionStates">
                                            <vsm:VisualState x:Name="Unselected" />
                                            <vsm:VisualState x:Name="Selected">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                                   Storyboard.TargetName="SelectedRectangle"
                                                                                   Duration="0:0:0.0">
                                                        <DiscreteObjectKeyFrame KeyTime="0%">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <Visibility>Visible</Visibility>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                            <vsm:VisualState x:Name="SelectedUnfocused">
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                                   Storyboard.TargetName="SelectedRectangle"
                                                                                   Duration="0:0:0.0">
                                                        <DiscreteObjectKeyFrame KeyTime="0%">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <Visibility>Visible</Visibility>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </vsm:VisualState>
                                        </vsm:VisualStateGroup>
                                        <vsm:VisualStateGroup x:Name="FocusStates">
                                            <vsm:VisualState x:Name="Focused" />
                                            <vsm:VisualState x:Name="Unfocused" />
                                        </vsm:VisualStateGroup>
                                    </vsm:VisualStateManager.VisualStateGroups>
                                    <Grid Cursor="Hand">
                                        <Border Name="HoverRectangle"
                                                Background="{StaticResource Brush.Background.Strong}"
                                                CornerRadius="0"
                                                Visibility="Hidden" />
                                        <Border x:Name="SelectedRectangle"
                                                Background="{StaticResource Brush.Background.Strong}"
                                                CornerRadius="0"
                                                Visibility="Hidden"
                                                IsHitTestVisible="False" />
                                        <ContentPresenter x:Name="Content"
                                                          Margin="{TemplateBinding Padding}"
                                                          ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                                          Content="{TemplateBinding Content}"
                                                          VerticalAlignment="Center"
                                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                          RenderOptions.ClearTypeHint="Enabled" />
                                    </Grid>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                    <Style.Triggers>
                        <Trigger Property="IsSelected"
                                 Value="True">
                            <Setter Property="Foreground"
                                    Value="{StaticResource Brush.Accent.Strong}" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <!-- modified default template without border and fixed padding on it-->
                <ControlTemplate TargetType="{x:Type ListBox}">
                    <ScrollViewer Focusable="False"
                                  Padding="{TemplateBinding Padding}">
                        <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    </ScrollViewer>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsGrouping"
                                           Value="True" />
                                <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping"
                                           Value="False" />
                            </MultiTrigger.Conditions>
                            <Setter Property="ScrollViewer.CanContentScroll"
                                    Value="False" />
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="DataGrid">
        <Setter Property="HorizontalGridLinesBrush"
                Value="LightGray" />
        <Setter Property="VerticalGridLinesBrush"
                Value="LightGray" />
    </Style>
</ResourceDictionary>
