<?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Color x:Key="Dark1Color">#666666</Color>
    <Color x:Key="Dark2Color">#555555</Color>
    <Color x:Key="Dark3Color">#444444</Color>
    <Color x:Key="Dark4Color">#333333</Color>
    <Color x:Key="Purple1Color">#6B69D6</Color>
    <Color x:Key="Purple2Color">#504FA1</Color>
    <Color x:Key="Purple3Color">#383773</Color>
    <Color x:Key="White1Color">#FFFFFF</Color>
    <Color x:Key="White2Color">#DDDDDD</Color>
    <Color x:Key="White3Color">#CCCCCC</Color>
    <Color x:Key="Blue1Color">#315891</Color>
    <Color x:Key="Blue2Color">#24416c</Color>
    <Color x:Key="Highlight1Color">#01BAEF</Color>
    <Color x:Key="RareColor">#0070DD</Color>
    <Color x:Key="EpicColor">#A335EE</Color>
    <Color x:Key="ControlPressedColor">#FF211AA9</Color>
    <Color x:Key="DisabledBorderLightColor">#FFAAAAAA</Color>
    <Color x:Key="ContentAreaColorLight">#FFC5CBF9</Color>
    <Color x:Key="ContentAreaColorDark">#FF7381F9</Color>
    <Color x:Key="ControlLightColor">White</Color>
    <Color x:Key="ControlMediumColor">#FF7381F9</Color>
    <Color x:Key="GlyphColor">#FFDDDDDD</Color>
    <Color x:Key="BorderLightColor">#FFCCCCCC</Color>
    <Color x:Key="BorderMediumColor">#FF888888</Color>
    <Color x:Key="BorderDarkColor">#FF444444</Color>
    <Color x:Key="PressedBorderLightColor">#FF888888</Color>
    <Color x:Key="PressedBorderDarkColor">#FF444444</Color>
    <Color x:Key="DisabledBorderDarkColor">#FF888888</Color>
    <Color x:Key="DefaultBorderBrushDarkColor">Black</Color>
    <Color x:Key="DisabledForegroundColor">#FF888888</Color>

    <SolidColorBrush x:Key="AccentColor" Color="#FFFFFF" />
    <SolidColorBrush x:Key="NavigationPrimary">#6B69D6</SolidColorBrush>
    <SolidColorBrush x:Key="Dark1">#666666</SolidColorBrush>
    <SolidColorBrush x:Key="Dark2">#555555</SolidColorBrush>
    <SolidColorBrush x:Key="Dark3">#444444</SolidColorBrush>
    <SolidColorBrush x:Key="Dark4">#333333</SolidColorBrush>
    <SolidColorBrush x:Key="White1Brush">#FFFFFF</SolidColorBrush>
    <SolidColorBrush x:Key="White2Brush">#DDDDDD</SolidColorBrush>
    <SolidColorBrush x:Key="White3Brush">#CCCCCC</SolidColorBrush>
    <SolidColorBrush x:Key="Purple1">#6B69D6</SolidColorBrush>
    <SolidColorBrush x:Key="Purple2">#504FA1</SolidColorBrush>
    <SolidColorBrush x:Key="Purple3">#383773</SolidColorBrush>
    <SolidColorBrush x:Key="Blue1Brush">#315891</SolidColorBrush>
    <SolidColorBrush x:Key="Blue2Brush">#24416c</SolidColorBrush>
    <SolidColorBrush x:Key="Highlight1Brush">#01BAEF</SolidColorBrush>
    <SolidColorBrush x:Key="RareBrush">#0070DD</SolidColorBrush>
    <SolidColorBrush x:Key="EpicBrush">#A335EE</SolidColorBrush>
    <SolidColorBrush x:Key="ContextMenuBackgroundBrush" Color="{StaticResource Dark4Color}" />
    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />
    <SolidColorBrush x:Key="SelectedBackgroundBrush" Color="{StaticResource Dark3Color}" />
    <SolidColorBrush x:Key="SolidBorderBrush" Color="{StaticResource White3Color}" />
    <SolidColorBrush x:Key="Purple2BorderBush" Color="{StaticResource Purple2Color}" />
    <SolidColorBrush x:Key="Purple3BorderBush" Color="{StaticResource Purple3Color}" />
    <SolidColorBrush x:Key="GlyphBrush" Color="{StaticResource White3Color}" />

    <LinearGradientBrush x:Key="NormalBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="Transparent" Offset="0.0"/>
                <GradientStop Color="Transparent" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="NormalBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="{StaticResource Purple2Color}" Offset="0.0"/>
                <GradientStop Color="{StaticResource Purple2Color}" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="MenuPopupBrush"
                     EndPoint="0.5,1"
                     StartPoint="0.5,0">
        <GradientStop Color="{DynamicResource Dark4Color}"
                Offset="0" />
        <GradientStop Color="{DynamicResource Dark4Color}"
                Offset="1" />
    </LinearGradientBrush>

    <Style TargetType="{x:Type TextBlock}">
        <Setter Property="Foreground" Value="White" />
        <Setter Property="FontFamily" Value="{StaticResource OpenSans}"/>
    </Style>

    <Style TargetType="{x:Type Button}">
        <Setter Property="FontFamily" Value="{StaticResource OpenSans}"/>
    </Style>

    <!--WINDOW CHROME-->
    <Style x:Key="TitleBarButtonStyle" TargetType="Button">
        <Setter Property="Foreground" Value="White" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border
					x:Name="border"
					Background="Transparent"
					BorderThickness="0"
					SnapsToDevicePixels="true">
                        <ContentPresenter
						x:Name="contentPresenter"
						Margin="0"
						HorizontalAlignment="Center"
						VerticalAlignment="Center"
						Focusable="False"
						RecognizesAccessKey="True" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="border" Property="Background" Value="{StaticResource Purple2}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="border" Property="Background" Value="{StaticResource Purple3}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="TitleBarCloseButtonStyle" TargetType="Button">
        <Setter Property="Foreground" Value="White" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border
					x:Name="border"
					Background="Transparent"
					BorderThickness="0"
					SnapsToDevicePixels="true">
                        <ContentPresenter
						x:Name="contentPresenter"
						Margin="0"
						HorizontalAlignment="Center"
						VerticalAlignment="Center"
						Focusable="False"
						RecognizesAccessKey="True" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="border" Property="Background" Value="{StaticResource Purple2}" />
                            <Setter Property="Foreground" Value="White" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="border" Property="Background" Value="{StaticResource Purple3}" />
                            <Setter Property="Foreground" Value="White" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="WindowMainPanelStyle" TargetType="{x:Type Border}">
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="1" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=WindowState}" Value="Maximized">
                <Setter Property="Margin" Value="6" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <!--END WINDOW CHROME-->

    <Style x:Key="labelTableHeader" TargetType="TextBlock">
        <Setter Property="FontWeight" Value="Bold" />
        <Setter Property="FontSize" Value="14" />
        <Setter Property="Foreground" Value="{StaticResource White2Brush}" />
    </Style>
    <Style x:Key="PurpleButtonInverse" TargetType="Button">
        <Setter Property="FontSize" Value="14" />
        <Setter Property="Foreground" Value="{StaticResource Purple2}" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border Background="{TemplateBinding Background}" 
                            BorderBrush="{StaticResource Purple3}" 
                            BorderThickness="1"
                            Padding="10, 5">
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="{StaticResource Dark2}"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{StaticResource Purple3}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="purpleButton" TargetType="Button">
        <Setter Property="FontSize" Value="14" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="Foreground" Value="{StaticResource White1Brush}" />
        <Setter Property="Background" Value="{StaticResource Purple2}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border Background="{TemplateBinding Background}" 
                            BorderBrush="Transparent" 
                            BorderThickness="0"
                            Padding="10, 5">
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="{StaticResource Dark2}"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{StaticResource Purple3}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="PurpleButtonLight" TargetType="Button">
        <Setter Property="FontSize" Value="14" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="Foreground" Value="{StaticResource White1Brush}" />
        <Setter Property="Background" Value="{StaticResource Purple1}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border Background="{TemplateBinding Background}" 
                            BorderBrush="Transparent" 
                            BorderThickness="0"
                            Padding="10, 5">
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="{StaticResource Dark2}"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{StaticResource Purple3}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="labelAddonName" TargetType="TextBlock">
        <Setter Property="FontWeight" Value="Bold" />
        <Setter Property="FontSize" Value="16" />
        <Setter Property="Foreground" Value="{StaticResource White1Brush}" />
    </Style>
    <Style x:Key="labelAddonText" TargetType="TextBlock">
        <Setter Property="FontSize" Value="13" />
        <Setter Property="Foreground" Value="{StaticResource White1Brush}" />
    </Style>

    <!--CONTEXT MENU-->
    <Style x:Key="{x:Static MenuItem.SeparatorStyleKey}"
       TargetType="Separator">
        <Setter Property="Height" Value="1"/>
        <Setter Property="Margin" Value="0,4,0,4"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Separator">
                    <Border BorderBrush="{StaticResource SolidBorderBrush}"
                BorderThickness="1"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- TopLevelHeader -->
    <ControlTemplate x:Key="{x:Static MenuItem.TopLevelHeaderTemplateKey}"
                 TargetType="MenuItem">
        <Border Name="Border" >
            <Grid>
                <ContentPresenter 
        Margin="6,3,6,3" 
        ContentSource="Header"
        RecognizesAccessKey="True" />
                <Popup 
        Name="Popup"
        Placement="Bottom"
        IsOpen="{TemplateBinding IsSubmenuOpen}"
        AllowsTransparency="True" 
        Focusable="False"
        PopupAnimation="Fade">
                    <Border 
          Name="SubmenuBorder"
          SnapsToDevicePixels="True"
          Background="{StaticResource ContextMenuBackgroundBrush}"
          BorderBrush="{StaticResource SolidBorderBrush}"
          BorderThickness="1" >
                        <StackPanel  
            IsItemsHost="True" 
            KeyboardNavigation.DirectionalNavigation="Cycle" />
                    </Border>
                </Popup>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                <Setter TargetName="Popup" Property="PopupAnimation" Value="None"/>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter TargetName="Border" Property="Background"
              Value="{StaticResource NormalBrush}"/>
                <Setter TargetName="Border" Property="BorderBrush"
              Value="Transparent"/>
            </Trigger>
            <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="True">
                <Setter TargetName="SubmenuBorder" Property="CornerRadius" Value="0,0,4,4"/>
                <Setter TargetName="SubmenuBorder" Property="Padding" Value="0,0,0,3"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <!-- TopLevelItem -->

    <ControlTemplate 
  x:Key="{x:Static MenuItem.TopLevelItemTemplateKey}" 
  TargetType="MenuItem">
        <Border Name="Border" >
            <Grid>
                <ContentPresenter 
        Margin="6,3,6,3" 
        ContentSource="Header"
        RecognizesAccessKey="True" />
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter TargetName="Border" Property="Background"
              Value="{StaticResource NormalBrush}"/>
                <Setter TargetName="Border" Property="BorderBrush" Value="Transparent"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground"
              Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!-- SubmenuItem -->

    <ControlTemplate 
  x:Key="{x:Static MenuItem.SubmenuItemTemplateKey}" 
  TargetType="MenuItem">
        <Border Name="Border"  >
            <Grid >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" SharedSizeGroup="Shortcut"/>
                    <ColumnDefinition Width="13"/>
                </Grid.ColumnDefinitions>
                <ContentPresenter 
        Name="Icon"
        Margin="6,0,6,0"
        VerticalAlignment="Center"
        ContentSource="Icon"/>
                <Border 
        Name="Check"  
        Width="13" Height="13" 
        Visibility="Collapsed"
        Margin="6,0,6,0" 
        Background="{StaticResource NormalBrush}"
        BorderThickness="1"
        BorderBrush="{StaticResource NormalBorderBrush}">
                    <Path Name="CheckMark"
                          Width="7" Height="7"
                          Visibility="Hidden"
                          SnapsToDevicePixels="False" 
                          Stroke="{StaticResource GlyphBrush}"
                          StrokeThickness="2"
                          Data="M 0 0 L 7 7 M 0 7 L 7 0" />
                </Border>
                <ContentPresenter 
        Name="HeaderHost"
        Grid.Column="1"
        ContentSource="Header"
        RecognizesAccessKey="True"/>
                <TextBlock x:Name="InputGestureText"
        Grid.Column="2"
        Text="{TemplateBinding InputGestureText}"
        Margin="5,2,0,2"
        DockPanel.Dock="Right" />
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Setter TargetName="CheckMark" Property="Visibility" Value="Visible"/>
            </Trigger>
            <Trigger Property="IsCheckable" Value="true">
                <Setter TargetName="Check" Property="Visibility" Value="Visible"/>
                <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter TargetName="Border" Property="Background"
              Value="{StaticResource SelectedBackgroundBrush}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!-- SubmenuHeader -->

    <ControlTemplate 
  x:Key="{x:Static MenuItem.SubmenuHeaderTemplateKey}" 
  TargetType="MenuItem">
        <Border Name="Border" >
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" SharedSizeGroup="Shortcut"/>
                    <ColumnDefinition Width="13"/>
                </Grid.ColumnDefinitions>
                <ContentPresenter 
        Name="Icon"
        Margin="6,0,6,0"
        VerticalAlignment="Center"
        ContentSource="Icon"/>
                <ContentPresenter 
        Name="HeaderHost"
        Grid.Column="1"
        ContentSource="Header"
        RecognizesAccessKey="True"/>
                <TextBlock x:Name="InputGestureText"
        Grid.Column="2"
        Text="{TemplateBinding InputGestureText}"
        Margin="5,2,2,2"
        DockPanel.Dock="Right"/>
                <Path 
        Grid.Column="3"
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Data="M 0 0 L 0 7 L 4 3.5 Z" 
        Fill="{StaticResource GlyphBrush}" />
                <Popup 
        Name="Popup"
        Placement="Right"
        HorizontalOffset="-4" 
        IsOpen="{TemplateBinding IsSubmenuOpen}"
        AllowsTransparency="True" 
        Focusable="False"
        PopupAnimation="Fade">
                    <Border 
          Name="SubmenuBorder"
          SnapsToDevicePixels="True"
          Background="{StaticResource ContextMenuBackgroundBrush}"
          BorderBrush="{StaticResource Purple2BorderBush}"
          BorderThickness="1" >
                        <StackPanel  
            IsItemsHost="True" 
            KeyboardNavigation.DirectionalNavigation="Cycle" />
                    </Border>
                </Popup>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter TargetName="Icon" Property="Visibility" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter TargetName="Border" Property="Background"
              Value="{StaticResource SelectedBackgroundBrush}"/>
            </Trigger>
            <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="True">
                <Setter TargetName="SubmenuBorder" Property="CornerRadius" Value="4"/>
                <Setter TargetName="SubmenuBorder" Property="Padding" Value="0,3,0,3"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!-- MenuItem Style -->

    <Style x:Key="{x:Type MenuItem}" TargetType="MenuItem">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Style.Triggers>
            <Trigger Property="Role" Value="TopLevelHeader">
                <Setter Property="Template"
              Value="{StaticResource {x:Static MenuItem.TopLevelHeaderTemplateKey}}"/>
                <Setter Property="Grid.IsSharedSizeScope" Value="true"/>
            </Trigger>
            <Trigger Property="Role" Value="TopLevelItem">
                <Setter Property="Template"
              Value="{StaticResource {x:Static MenuItem.TopLevelItemTemplateKey}}"/>
            </Trigger>
            <Trigger Property="Role" Value="SubmenuHeader">
                <Setter Property="Template"
              Value="{StaticResource {x:Static MenuItem.SubmenuHeaderTemplateKey}}"/>
            </Trigger>
            <Trigger Property="Role" Value="SubmenuItem">
                <Setter Property="Template"
              Value="{StaticResource {x:Static MenuItem.SubmenuItemTemplateKey}}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--DARK-->
    <ControlTemplate x:Key="DarkHeaderMenuItemTemplateKey" TargetType="MenuItem">
        <Border Name="Border" BorderThickness="0 0 0 1" BorderBrush="{StaticResource White2Brush}"
                Padding="4">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Border Grid.Column="0" Margin="0 0 4 0">
                    <StackPanel>
                        <Image Source="{Binding ThumbnailUrl, Converter={StaticResource UriToThumbnailConverter}}" Width="30" Height="30" />
                    </StackPanel>
                </Border>
                <Border Grid.Column="1">
                    <StackPanel>
                        <TextBlock Text="{Binding Name}" />
                        <TextBlock Text="{Binding CurrentVersion}" Foreground="{StaticResource White3Brush}" />
                    </StackPanel>
                </Border>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}">
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
            </Trigger>
            <Trigger Property="IsCheckable" Value="true">
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter TargetName="Border" Property="Background"
              Value="{StaticResource Dark2}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="{StaticResource White2Brush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="DarkHeaderMenuItem" TargetType="MenuItem">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Style.Triggers>
            <Trigger Property="Role" Value="TopLevelItem">
                <Setter Property="Template" Value="{StaticResource DarkHeaderMenuItemTemplateKey}"/>
            </Trigger>

            <Trigger Property="Role" Value="SubmenuItem">
                <Setter Property="Template" Value="{StaticResource DarkHeaderMenuItemTemplateKey}"/>
            </Trigger>
            <Trigger Property="IsChecked" Value="True">
                <Setter Property="Foreground" Value="Green"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="DarkMenu" TargetType="{x:Type ContextMenu}">
        <Setter Property="SnapsToDevicePixels"
          Value="True" />
        <Setter Property="OverridesDefaultStyle"
          Value="True" />
        <Setter Property="Grid.IsSharedSizeScope"
          Value="true" />
        <Setter Property="HasDropShadow"
          Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContextMenu}">
                    <Border x:Name="Border"
                Background="{StaticResource MenuPopupBrush}"
                BorderThickness="1">
                        <Border.BorderBrush>
                            <SolidColorBrush Color="{StaticResource Purple2Color}" />
                        </Border.BorderBrush>
                        <StackPanel IsItemsHost="True"
                      KeyboardNavigation.DirectionalNavigation="Cycle" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasDropShadow"
                   Value="true">
                            <Setter TargetName="Border"
                    Property="Padding"
                    Value="0,3,0,3" />
                            <Setter TargetName="Border"
                    Property="CornerRadius"
                    Value="4" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Flat ComboBox -->
    <SolidColorBrush x:Key="ComboBoxNormalBorderBrush" Color="Transparent" />
    <SolidColorBrush x:Key="ComboBoxNormalBackgroundBrush" Color="{StaticResource Purple2Color}" />
    <SolidColorBrush x:Key="ComboBoxDisabledForegroundBrush" Color="#888" />
    <SolidColorBrush x:Key="ComboBoxDisabledBackgroundBrush" Color="#eee" />
    <SolidColorBrush x:Key="ComboBoxDisabledBorderBrush" Color="#888" />

    <ControlTemplate TargetType="ToggleButton" x:Key="ComboBoxToggleButtonTemplate">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="20" />
            </Grid.ColumnDefinitions>
            <Border Grid.ColumnSpan="2" Name="Border"
              BorderBrush="{StaticResource ComboBoxNormalBorderBrush}" 
              CornerRadius="0" BorderThickness="1, 1, 1, 1" 
              Background="{StaticResource ComboBoxNormalBackgroundBrush}" />
            <Border Grid.Column="1" Margin="1, 1, 1, 1" BorderBrush="#444" Name="ButtonBorder"
              CornerRadius="0, 0, 0, 0" BorderThickness="0, 0, 0, 0" 
              Background="{StaticResource ComboBoxNormalBackgroundBrush}" />

            <Path Name="Arrow" Grid.Column="1" 
            Data="M0,0 L0,2 L4,6 L8,2 L8,0 L4,4 z"
            HorizontalAlignment="Center" Fill="White"
            VerticalAlignment="Center" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="UIElement.IsMouseOver" Value="True">
                <Setter Property="Panel.Background" TargetName="ButtonBorder" Value="{StaticResource Purple3}"/>
            </Trigger>
            <Trigger Property="ToggleButton.IsChecked" Value="True">
                <Setter Property="Panel.Background" TargetName="ButtonBorder" Value="{StaticResource Purple2}"/>
                <Setter Property="Shape.Fill" TargetName="Arrow" Value="White"/>
            </Trigger>
            <Trigger Property="UIElement.IsEnabled" Value="False">
                <Setter Property="Panel.Background" TargetName="Border" Value="{StaticResource ComboBoxDisabledBackgroundBrush}"/>
                <Setter Property="Panel.Background" TargetName="ButtonBorder" Value="{StaticResource ComboBoxDisabledBackgroundBrush}"/>
                <Setter Property="Border.BorderBrush" TargetName="ButtonBorder" Value="{StaticResource ComboBoxDisabledBorderBrush}"/>
                <Setter Property="TextElement.Foreground" Value="{StaticResource ComboBoxDisabledForegroundBrush}"/>
                <Setter Property="Shape.Fill" TargetName="Arrow" Value="White"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="ComboBoxFlatStyle"  TargetType="{x:Type ComboBox}">
        <Setter Property="UIElement.SnapsToDevicePixels" Value="True"/>
        <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
        <Setter Property="TextElement.Foreground" Value="White"/>
        <Setter Property="TextElement.FontSize" Value="14"/>
        <Setter Property="FrameworkElement.FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    <Grid>
                        <ToggleButton Name="ToggleButton" 
                                      Grid.Column="2"                
                                      ClickMode="Press" 
                                      Focusable="False"
                                      Foreground="Red"
                                      IsChecked="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                      Template="{StaticResource ComboBoxToggleButtonTemplate}"/>

                        <ContentPresenter Name="ContentSite" Margin="5, 3, 23, 3" IsHitTestVisible="False"
                              HorizontalAlignment="Left" VerticalAlignment="Center"                              
                              Content="{TemplateBinding ComboBox.SelectionBoxItem}" 
                              ContentTemplate="{TemplateBinding ComboBox.SelectionBoxItemTemplate}"
                              ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
                        <TextBox Name="PART_EditableTextBox" 
                                 Margin="3, 3, 23, 3"                     
                                 IsReadOnly="{TemplateBinding IsReadOnly}"
                                 Visibility="Hidden" 
                                 Background="Transparent"
                                 Foreground="White"
                                 HorizontalAlignment="Left"
                                 VerticalAlignment="Center"
                                 Focusable="True" >
                            <TextBox.Template>
                                <ControlTemplate TargetType="TextBox" >
                                    <Border Name="PART_ContentHost" Focusable="False" />
                                </ControlTemplate>
                            </TextBox.Template>
                        </TextBox>
                        <!-- Popup showing items -->
                        <Popup Name="Popup" Placement="Bottom"
                   Focusable="False" AllowsTransparency="True"
                   IsOpen="{TemplateBinding ComboBox.IsDropDownOpen}"
                   PopupAnimation="Slide">
                            <Grid Name="DropDown" SnapsToDevicePixels="True"
                    MinWidth="{TemplateBinding FrameworkElement.ActualWidth}"
                    MaxHeight="{TemplateBinding ComboBox.MaxDropDownHeight}">
                                <Border Name="DropDownBorder" 
                                        Background="{StaticResource Purple1}" 
                                        Margin="0, 1, 0, 0"
                        CornerRadius="0" BorderThickness="1,1,1,1" 
                        BorderBrush="{StaticResource ComboBoxNormalBorderBrush}"/>
                                <ScrollViewer Margin="4" SnapsToDevicePixels="True">
                                    <ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Grid>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ItemsControl.HasItems" Value="False">
                            <Setter Property="FrameworkElement.MinHeight" TargetName="DropDownBorder" Value="95"/>
                        </Trigger>
                        <Trigger Property="UIElement.IsEnabled" Value="False">
                            <Setter Property="TextElement.Foreground" Value="{StaticResource ComboBoxDisabledForegroundBrush}"/>
                        </Trigger>
                        <Trigger Property="ItemsControl.IsGrouping" Value="True">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
                        </Trigger>
                        <Trigger Property="ComboBox.IsEditable" Value="True">
                            <Setter Property="KeyboardNavigation.IsTabStop" Value="False"/>
                            <Setter Property="UIElement.Visibility" TargetName="PART_EditableTextBox" Value="Visible"/>
                            <Setter Property="UIElement.Visibility" TargetName="ContentSite" Value="Hidden"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- End of Flat ComboBox -->

    <!--TAB CONTROL-->


    <Style x:Key="CustomTabStyle"  TargetType="TabControl">
        <Setter Property="OverridesDefaultStyle"
          Value="True" />
        <Setter Property="SnapsToDevicePixels"
          Value="True" />
        <Setter Property="Background" Value="Red"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid KeyboardNavigation.TabNavigation="Local" Background="{StaticResource Purple1}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                Storyboard.TargetProperty="(Border.BorderBrush).
                    (SolidColorBrush.Color)">
                                            <EasingColorKeyFrame KeyTime="0"
                                         Value="#FFAAAAAA" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Background="{StaticResource Purple1}" BorderThickness="1" BorderBrush="{StaticResource Purple1}">
                            <TabPanel x:Name="HeaderPanel"
                            Grid.Row="0"
                            Panel.ZIndex="1"
                            Margin="0,0,0,-1"
                            IsItemsHost="True"
                                  HorizontalAlignment="Center"
                            Background="{StaticResource Purple1}"
                            KeyboardNavigation.TabIndex="1" />
                        </Border>
                        <Border x:Name="Border"
                          Grid.Row="1"
                          BorderThickness="0"
                          CornerRadius="2"
                          KeyboardNavigation.TabNavigation="Local"
                          KeyboardNavigation.DirectionalNavigation="Contained"
                          KeyboardNavigation.TabIndex="2">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1"
                                   StartPoint="0.5,0">
                                    <GradientStop Color="{DynamicResource ContentAreaColorLight}"
                              Offset="0" />
                                    <GradientStop Color="{DynamicResource ContentAreaColorDark}"
                              Offset="1" />
                                </LinearGradientBrush>
                            </Border.Background>
                            <Border.BorderBrush>
                                <SolidColorBrush Color="Green"/>
                            </Border.BorderBrush>
                            <ContentPresenter x:Name="PART_SelectedContentHost"
                              Margin="0"
                              ContentSource="SelectedContent" />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CustomTabItemStyle" TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <!--<Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                Storyboard.TargetProperty="(Panel.Background).
                    (GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                            <EasingColorKeyFrame KeyTime="0"
                                         Value="{StaticResource Dark1Color}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)"
                                                    Storyboard.TargetName="Border">
                                            <EasingThicknessKeyFrame KeyTime="0"
                                             Value="1,1,1,0" />
                                        </ThicknessAnimationUsingKeyFrames>
                                    </Storyboard>-->
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <!--<Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                Storyboard.TargetProperty="(Panel.Background).
                    (GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                            <EasingColorKeyFrame KeyTime="0"
                                         Value="{StaticResource DisabledControlDarkColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                Storyboard.TargetProperty="(Border.BorderBrush).
                    (SolidColorBrush.Color)">
                                            <EasingColorKeyFrame KeyTime="0"
                                         Value="{StaticResource DisabledBorderLightColor}"/>
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>-->
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border"
                                Margin="0"
                                BorderThickness="0"
                                CornerRadius="0 0 0 0">
                            <Border.BorderBrush>
                                <SolidColorBrush Color="Transparent" />
                            </Border.BorderBrush>
                            <Border.Background>
                                <SolidColorBrush Color="Transparent" />
                            </Border.Background>
                            <ContentPresenter x:Name="ContentSite"
                                              VerticalAlignment="Center"
                                              HorizontalAlignment="Center"
                                              ContentSource="Header"
                                              Margin="12,2,12,2"
                                              TextBlock.Foreground="White"
                                              RecognizesAccessKey="True">
                            </ContentPresenter>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Panel.ZIndex" Value="100" />
                            <Setter Property="TextElement.FontSize" TargetName="ContentSite" Value="16"/>
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource Dark3}"/>
                            <Setter Property="TextElement.FontWeight" TargetName="ContentSite" Value="DemiBold"/>
                            <Setter Property="TextElement.Foreground" TargetName="ContentSite" Value="{StaticResource White1Brush}"/>
                        </Trigger>
                        <Trigger Property="IsSelected" Value="False">
                            <Setter Property="TextElement.Foreground" TargetName="ContentSite" Value="{StaticResource White2Brush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--PLACEHOLDER TEXT-->
    <Style x:Key="placeHolder" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Grid>
                        <TextBox Text="{Binding Path=Text,
                                                RelativeSource={RelativeSource TemplatedParent}, 
                                                Mode=TwoWay,
                                                UpdateSourceTrigger=PropertyChanged}"
                                 x:Name="textSource" 
                                 Background="Transparent" 
                                 Panel.ZIndex="2" />
                        <TextBox Text="{TemplateBinding Tag}" Background="{TemplateBinding Background}" Panel.ZIndex="1">
                            <TextBox.Style>
                                <Style TargetType="{x:Type TextBox}">
                                    <Setter Property="Foreground" Value="Transparent"/>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding Path=Text, Source={x:Reference textSource}}" Value="">
                                            <Setter Property="Foreground" Value="LightGray"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </TextBox.Style>
                        </TextBox>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--SCROLL BAR-->


    <Style x:Key="ScrollBarLineButton"
       TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels"
          Value="True" />
        <Setter Property="OverridesDefaultStyle"
          Value="true" />
        <Setter Property="Focusable"
          Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border x:Name="Border"
                Margin="1"
                CornerRadius="2"
                BorderThickness="1">
                        <Border.BorderBrush>
                            <LinearGradientBrush StartPoint="0,0"
                                 EndPoint="0,1">
                                <LinearGradientBrush.GradientStops>
                                    <GradientStopCollection>
                                        <GradientStop Color="{DynamicResource Purple3Color}"
                                Offset="0.0" />
                                        <GradientStop Color="{DynamicResource Purple3Color}"
                                Offset="1.0" />
                                    </GradientStopCollection>
                                </LinearGradientBrush.GradientStops>
                            </LinearGradientBrush>
                        </Border.BorderBrush>
                        <Border.Background>
                            <LinearGradientBrush StartPoint="0,0"
                                 EndPoint="1,1">
                                <LinearGradientBrush.GradientStops>
                                    <GradientStopCollection>
                                        <GradientStop Color="{DynamicResource Purple1Color}"/>
                                        <GradientStop Color="{DynamicResource Purple2Color}"
                                Offset="1.0" />
                                    </GradientStopCollection>
                                </LinearGradientBrush.GradientStops>
                            </LinearGradientBrush>
                        </Border.Background>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                Storyboard.TargetProperty="(Panel.Background).
                    (GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                            <EasingColorKeyFrame KeyTime="0"
                                         Value="{StaticResource ControlPressedColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Arrow"
                                                Storyboard.TargetProperty="(Shape.Fill).
                    (SolidColorBrush.Color)">
                                            <EasingColorKeyFrame KeyTime="0"
                                         Value="{StaticResource DisabledForegroundColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Path x:Name="Arrow"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Data="{Binding Content, 
            RelativeSource={RelativeSource TemplatedParent}}" >
                            <Path.Fill>
                                <SolidColorBrush Color="{DynamicResource GlyphColor}"/>
                            </Path.Fill>
                        </Path>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarPageButton"
       TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels"
          Value="True" />
        <Setter Property="OverridesDefaultStyle"
          Value="true" />
        <Setter Property="IsTabStop"
          Value="false" />
        <Setter Property="Focusable"
          Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarThumb"
       TargetType="{x:Type Thumb}">
        <Setter Property="SnapsToDevicePixels"
          Value="True" />
        <Setter Property="OverridesDefaultStyle"
          Value="true" />
        <Setter Property="IsTabStop"
          Value="false" />
        <Setter Property="Focusable"
          Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border CornerRadius="2"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="1" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="VerticalScrollBar"
                 TargetType="{x:Type ScrollBar}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition MaxHeight="18" />
                <RowDefinition Height="0.00001*" />
                <RowDefinition MaxHeight="18" />
            </Grid.RowDefinitions>
            <Border Grid.RowSpan="3"
            CornerRadius="2"
            Background="{StaticResource Dark2}" />
            <RepeatButton Grid.Row="0"
                  Style="{StaticResource ScrollBarLineButton}"
                  Height="18"
                  Command="ScrollBar.LineUpCommand"
                  Content="M 0 4 L 8 4 L 4 0 Z" />
            <Track x:Name="PART_Track"
           Grid.Row="1"
           IsDirectionReversed="true">
                <Track.DecreaseRepeatButton>
                    <RepeatButton Style="{StaticResource ScrollBarPageButton}"
                      Command="ScrollBar.PageUpCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb Style="{StaticResource ScrollBarThumb}"
               Margin="1,0,1,0">
                        <Thumb.BorderBrush>

                            <LinearGradientBrush StartPoint="0,0"
                                 EndPoint="1,0">
                                <LinearGradientBrush.GradientStops>
                                    <GradientStopCollection>
                                        <GradientStop Color="{DynamicResource Purple3Color}"
                                Offset="0.0" />
                                        <GradientStop Color="{DynamicResource Purple3Color}"
                                Offset="1.0" />
                                    </GradientStopCollection>
                                </LinearGradientBrush.GradientStops>
                            </LinearGradientBrush>

                        </Thumb.BorderBrush>
                        <Thumb.Background>

                            <LinearGradientBrush StartPoint="0,0"
                                 EndPoint="1,1">
                                <LinearGradientBrush.GradientStops>
                                    <GradientStopCollection>
                                        <GradientStop Color="{DynamicResource Purple1Color}"
                                Offset="0.0" />
                                        <GradientStop Color="{DynamicResource Purple2Color}"
                                Offset="1.0" />
                                    </GradientStopCollection>
                                </LinearGradientBrush.GradientStops>
                            </LinearGradientBrush>

                        </Thumb.Background>
                    </Thumb>
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Style="{StaticResource ScrollBarPageButton}"
                      Command="ScrollBar.PageDownCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton Grid.Row="2"
                  Style="{StaticResource ScrollBarLineButton}"
                  Height="18"
                  Command="ScrollBar.LineDownCommand"
                  Content="M 0 0 L 4 4 L 8 0 Z" />
        </Grid>
    </ControlTemplate>


    <ControlTemplate x:Key="HorizontalScrollBar"
                 TargetType="{x:Type ScrollBar}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition MaxWidth="18" />
                <ColumnDefinition Width="0.00001*" />
                <ColumnDefinition MaxWidth="18" />
            </Grid.ColumnDefinitions>
            <Border Grid.ColumnSpan="3"
            CornerRadius="2"
            Background="{StaticResource Dark2}" />
            <RepeatButton Grid.Column="0"
                  Style="{StaticResource ScrollBarLineButton}"
                  Width="18"
                  Command="ScrollBar.LineLeftCommand"
                  Content="M 4 0 L 4 8 L 0 4 Z" />
            <Track x:Name="PART_Track"
           Grid.Column="1"
           IsDirectionReversed="False">
                <Track.DecreaseRepeatButton>
                    <RepeatButton Style="{StaticResource ScrollBarPageButton}"
                      Command="ScrollBar.PageLeftCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb Style="{StaticResource ScrollBarThumb}"
               Margin="0,1,0,1">

                        <Thumb.BorderBrush>

                            <LinearGradientBrush StartPoint="0,0"
                                 EndPoint="1,1">
                                <LinearGradientBrush.GradientStops>
                                    <GradientStopCollection>
                                        <GradientStop Color="{DynamicResource Purple3Color}"
                                Offset="0.0" />
                                        <GradientStop Color="{DynamicResource Purple3Color}"
                                Offset="1.0" />
                                    </GradientStopCollection>
                                </LinearGradientBrush.GradientStops>
                            </LinearGradientBrush>

                        </Thumb.BorderBrush>
                        <Thumb.Background>

                            <LinearGradientBrush StartPoint="0,0"
                                 EndPoint="0,1">
                                <LinearGradientBrush.GradientStops>
                                    <GradientStopCollection>
                                        <GradientStop Color="{DynamicResource Purple1Color}"
                                Offset="0.0" />
                                        <GradientStop Color="{DynamicResource Purple2Color}"
                                Offset="1.0" />
                                    </GradientStopCollection>
                                </LinearGradientBrush.GradientStops>
                            </LinearGradientBrush>

                        </Thumb.Background>
                    </Thumb>
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Style="{StaticResource ScrollBarPageButton}"
                      Command="ScrollBar.PageRightCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton Grid.Column="2"
                  Style="{StaticResource ScrollBarLineButton}"
                  Width="18"
                  Command="ScrollBar.LineRightCommand"
                  Content="M 0 0 L 4 4 L 0 8 Z" />
        </Grid>
    </ControlTemplate>

    <Style x:Key="{x:Type ScrollBar}"
       TargetType="{x:Type ScrollBar}">
        <Setter Property="SnapsToDevicePixels"
          Value="True" />
        <Setter Property="OverridesDefaultStyle"
          Value="true" />
        <Style.Triggers>
            <Trigger Property="Orientation"
             Value="Horizontal">
                <Setter Property="Width"
              Value="Auto" />
                <Setter Property="Height"
              Value="18" />
                <Setter Property="Template"
              Value="{StaticResource HorizontalScrollBar}" />
            </Trigger>
            <Trigger Property="Orientation"
             Value="Vertical">
                <Setter Property="Width"
              Value="18" />
                <Setter Property="Height"
              Value="Auto" />
                <Setter Property="Template"
              Value="{StaticResource VerticalScrollBar}" />
            </Trigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary>