	  
	   
    
		

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="clr-namespace:C1.WPF">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--******************** ClearStyle ScrollBar *********************-->

    <!-- CornerRadius @ ScrollBar -->
    <CornerRadius x:Key="ScrollBarCornerRadius">0</CornerRadius>
    <!-- CornerRadius @ ScrollBar InnerBorder -->
    <CornerRadius x:Key="ScrollBarInnerCornerRadius">0</CornerRadius>

    <!-- BrushBuilder @ Vertical ScrollBar Background -->
    <Style x:Key="ScrollVerticalBrush" TargetType="c1:C1BrushBuilder">
        
        
        <Setter Property="DesignBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                    <GradientStop Color="#E1E1E1" Offset="0" />
                    <GradientStop Color="#EDEDED" Offset="0.20" />
                    <GradientStop Color="#EDEDED" Offset="0.80" />
                    <GradientStop Color="#E3E3E3" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="DesignColor" Value="#FFDCDCDC" />
    </Style>
    <!-- BrushBuilder @ Horizontal ScrollBar Background -->
    <Style x:Key="ScrollHorizontalBrush" TargetType="c1:C1BrushBuilder">
        
        
        <Setter Property="DesignBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#E1E1E1" Offset="0" />
                    <GradientStop Color="#EDEDED" Offset="0.20" />
                    <GradientStop Color="#EDEDED" Offset="0.80" />
                    <GradientStop Color="#E3E3E3" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="DesignColor" Value="#FFDCDCDC" />
    </Style>

    <!--****************** WPF ClearStyle ScrollBar *******************-->

    
     <SolidColorBrush x:Key="ScrollBarDisabledBackground" Color="#F4F4F4" />
    
     <Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Focusable" Value="false" />
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
  
    <Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Focusable" Value="false" />
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarVerticalButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Focusable" Value="false" />
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Grid x:Name="Root" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1BrushBuilder x:Name="MouseOverBrush" Input="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" DesignBrush="{StaticResource GeneralVGradientOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
                        <c1:C1BrushBuilder x:Name="PressedBrush" Input="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" DesignBrush="{StaticResource GeneralVGradientSelectedBackground}" DesignColor="{StaticResource SelectedColor}" />
                        <Border x:Name="MouseOverElement" BorderBrush="{TemplateBinding BorderBrush}" Background="{Binding ElementName=MouseOverBrush, Path=Output}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed" />
                        <Border x:Name="PressedElement" BorderBrush="{TemplateBinding BorderBrush}" Background="{Binding ElementName=PressedBrush, Path=Output}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed" />
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" IsHitTestVisible="False" Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarHorizontalButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Focusable" Value="false" />
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Grid x:Name="Root" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1BrushBuilder x:Name="MouseOverBrush" Input="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" DesignBrush="{StaticResource GeneralGradientOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
                        <c1:C1BrushBuilder x:Name="PressedBrush" Input="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" DesignBrush="{StaticResource GeneralGradientSelectedBackground}" DesignColor="{StaticResource SelectedColor}" />
                        <Border x:Name="MouseOverElement" BorderBrush="{TemplateBinding BorderBrush}" Background="{Binding ElementName=MouseOverBrush, Path=Output}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed" />
                        <Border x:Name="PressedElement" BorderBrush="{TemplateBinding BorderBrush}" Background="{Binding ElementName=PressedBrush, Path=Output}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed" />
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" IsHitTestVisible="False" Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarVerticalThumb" TargetType="{x:Type Thumb}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="ThumbVisual" Margin="0,1,0,1">
                            <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource GeneralVGradientBrush}" DesignColor="#FFDCDCDC" />
                            <c1:C1BrushBuilder x:Name="MouseOverBrush" Input="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" DesignBrush="{StaticResource GeneralVGradientOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
                            <c1:C1BrushBuilder x:Name="PressedBrush" Input="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" DesignBrush="{StaticResource GeneralVGradientSelectedBackground}" DesignColor="{StaticResource SelectedColor}" />
                            <Border x:Name="BackgroundElement" Background="{Binding ElementName=BackgroundBrush, Path=Output}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" />
                            <Border x:Name="MouseOverElement" Background="{Binding ElementName=MouseOverBrush, Path=Output}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed" />
                            <Border x:Name="PressedElement" Background="{Binding ElementName=PressedBrush, Path=Output}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed" />
                            <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" IsHitTestVisible="False" Visibility="Collapsed" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarHorizontalThumb" TargetType="{x:Type Thumb}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="ThumbVisual" Margin="0,1,0,1">
                            <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource GeneralGradientBrush}" DesignColor="#FFDCDCDC" />
                            <c1:C1BrushBuilder x:Name="MouseOverBrush" Input="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" DesignBrush="{StaticResource GeneralGradientOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
                            <c1:C1BrushBuilder x:Name="PressedBrush" Input="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" DesignBrush="{StaticResource GeneralGradientSelectedBackground}" DesignColor="{StaticResource SelectedColor}" />
                            <Border x:Name="BackgroundElement" Background="{Binding ElementName=BackgroundBrush, Path=Output}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" />
                            <Border x:Name="MouseOverElement" Background="{Binding ElementName=MouseOverBrush, Path=Output}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed" />
                            <Border x:Name="PressedElement" Background="{Binding ElementName=PressedBrush, Path=Output}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed" />
                            <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" IsHitTestVisible="False" Visibility="Collapsed" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--***************************************************************-->


    <!-- ScrollBar used in controls with ClearStyle -->
    <Style x:Key="ScrollBarClearStyle" TargetType="ScrollBar">
        
        
        <Setter Property="Background" Value="{StaticResource WpfInputBaseBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrushColor}" />
        <Setter Property="c1:ClearStyleExtensions.CornerRadius" Value="{StaticResource ScrollBarCornerRadius}" />
        <Setter Property="c1:ClearStyleExtensions.ButtonCornerRadius" Value="{StaticResource GeneralCornerRadius}" />
        <Setter Property="Width" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
        <Setter Property="MinWidth" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollBar}">
                    <Grid x:Name="Bg" SnapsToDevicePixels="true">
                        <Grid.RowDefinitions>
                            <RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}" />
                            <RowDefinition Height="0.00001*" />
                            <RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}" />
                        </Grid.RowDefinitions>
                        <c1:C1BrushBuilder x:Name="VBackgroundBrush" Input="{TemplateBinding Background}" Style="{StaticResource ScrollVerticalBrush}" />
                        <c1:ScrollBarCornerRadiusBuilder x:Name="TopButtonCornerRadius" TopRight="True" ScrollBarCornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" ButtonCornerRadius="{TemplateBinding c1:ClearStyleExtensions.ButtonCornerRadius}" />
                        <c1:ScrollBarCornerRadiusBuilder x:Name="BottomButtonCornerRadius" BottomRight="True" ScrollBarCornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" ButtonCornerRadius="{TemplateBinding c1:ClearStyleExtensions.ButtonCornerRadius}" />
                        <Border Grid.RowSpan="5" Background="{Binding Output,ElementName=VBackgroundBrush}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" />
                        <RepeatButton Command="{x:Static ScrollBar.LineUpCommand}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" c1:ClearStyleExtensions.CornerRadius="{Binding ElementName=TopButtonCornerRadius,Path=Output}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Style="{StaticResource ScrollBarVerticalButton}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center">
                            <Path Stretch="Fill" Fill="{TemplateBinding Foreground}" Height="4" Width="8" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z " />
                        </RepeatButton>
                        <Track x:Name="PART_Track" IsDirectionReversed="true" Grid.Row="1">
                            <Track.DecreaseRepeatButton>
                                <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}" />
                            </Track.DecreaseRepeatButton>
                            <Track.IncreaseRepeatButton>
                                <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}" />
                            </Track.IncreaseRepeatButton>
                            <Track.Thumb>
                                <Thumb Background="{TemplateBinding Background}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" c1:ClearStyleExtensions.CornerRadius="{TemplateBinding c1:ClearStyleExtensions.ButtonCornerRadius}" Style="{StaticResource ScrollBarVerticalThumb}" />
                            </Track.Thumb>
                        </Track>
                        <RepeatButton Command="{x:Static ScrollBar.LineDownCommand}" Grid.Row="2" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" c1:ClearStyleExtensions.CornerRadius="{Binding ElementName=BottomButtonCornerRadius,Path=Output}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Style="{StaticResource ScrollBarVerticalButton}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center">
                            <Path Fill="{TemplateBinding Foreground}" Stretch="Fill" Height="4" Width="8" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z " />
                        </RepeatButton>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="BorderThickness" Value="1" />
                <Setter Property="Foreground" Value="{StaticResource ForegroundBrushColor}" />
                <Setter Property="c1:ClearStyleExtensions.CornerRadius" Value="{StaticResource ScrollBarCornerRadius}" />
                <Setter Property="Width" Value="Auto" />
                <Setter Property="MinWidth" Value="0" />
                <Setter Property="Height" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}" />
                <Setter Property="MinHeight" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ScrollBar}">
                            <Grid x:Name="Bg" SnapsToDevicePixels="true">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}" />
                                    <ColumnDefinition Width="0.00001*" />
                                    <ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}" />
                                </Grid.ColumnDefinitions>
                                <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{TemplateBinding Background}" Style="{StaticResource ScrollHorizontalBrush}" />
                                <c1:ScrollBarCornerRadiusBuilder x:Name="LeftButtonCornerRadius" BottomLeft="True" ScrollBarCornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" ButtonCornerRadius="{TemplateBinding c1:ClearStyleExtensions.ButtonCornerRadius}" />
                                <c1:ScrollBarCornerRadiusBuilder x:Name="RightButtonCornerRadius" BottomRight="True" ScrollBarCornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" ButtonCornerRadius="{TemplateBinding c1:ClearStyleExtensions.ButtonCornerRadius}" />
                                <Border Grid.ColumnSpan="5" Background="{Binding Output,ElementName=BackgroundBrush}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" />
                                <RepeatButton Command="{x:Static ScrollBar.LineLeftCommand}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" c1:ClearStyleExtensions.CornerRadius="{Binding ElementName=LeftButtonCornerRadius,Path=Output}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Style="{StaticResource ScrollBarHorizontalButton}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center">
                                    <Path Stretch="Fill" Fill="{TemplateBinding Foreground}" Height="8" Width="4" Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z " />
                                </RepeatButton>
                                <Track x:Name="PART_Track" Grid.Column="1">
                                    <Track.DecreaseRepeatButton>
                                        <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}" />
                                    </Track.DecreaseRepeatButton>
                                    <Track.IncreaseRepeatButton>
                                        <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}" />
                                    </Track.IncreaseRepeatButton>
                                    <Track.Thumb>
                                        <Thumb Background="{TemplateBinding Background}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" c1:ClearStyleExtensions.CornerRadius="{TemplateBinding c1:ClearStyleExtensions.ButtonCornerRadius}" Style="{StaticResource ScrollBarHorizontalThumb}" />
                                    </Track.Thumb>
                                </Track>
                                <RepeatButton Grid.Column="2" Command="{x:Static ScrollBar.LineRightCommand}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" c1:ClearStyleExtensions.CornerRadius="{Binding ElementName=RightButtonCornerRadius,Path=Output}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Style="{StaticResource ScrollBarHorizontalButton}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center">
                                    <Path Stretch="Fill" Fill="{TemplateBinding Foreground}" Height="8" Width="4" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z " />
                                </RepeatButton>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!-- Scroll Viewer -->
    <Style x:Key="ScrollViewerClearStyle" TargetType="ScrollViewer">
        
        
        <Setter Property="c1:ClearStyleExtensions.ButtonBackground" Value="{StaticResource WpfInputBaseBrush}" />
        <Setter Property="c1:ClearStyleExtensions.MouseOverBrush" Value="{StaticResource WpfInputMouseOverBrush}" />
        <Setter Property="c1:ClearStyleExtensions.PressedBrush" Value="{StaticResource WpfInputSelectedBackground}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="VerticalScrollBarVisibility" Value="Visible" />
        <Setter Property="Padding" Value="4" />
        <Setter Property="c1:ClearStyleExtensions.CornerRadius" Value="2" />
        <Setter Property="c1:ClearStyleExtensions.ButtonForeground" Value="{StaticResource ForegroundBrushColor}" />
        <Setter Property="c1:ClearStyleExtensions.ScrollBarStyle" Value="{StaticResource ScrollBarClearStyle}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollViewer">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            
                            
                            <c1:ScrollViewerCornerRadiusBuilder x:Name="verticalRadiusBuilder" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Orientation="Vertical" VerticalScrollBarVisibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" HorizontalScrollBarVisibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
                            <c1:ScrollViewerCornerRadiusBuilder x:Name="horizontalRadiusBuilder" Orientation="Horizontal" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" VerticalScrollBarVisibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" HorizontalScrollBarVisibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
                            <c1:ScrollViewerContentPresenterClip x:Name="contentPresenterClip" ScrollContentPresenter="{Binding ElementName=PART_ScrollContentPresenter}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" VerticalScrollBarVisibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" HorizontalScrollBarVisibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
                            <Grid Clip="{Binding Output,ElementName=contentPresenterClip}">
                                <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}" />
                            </Grid>
                            <ScrollBar x:Name="PART_VerticalScrollBar" Grid.Column="1" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Orientation="Vertical" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{TemplateBinding VerticalOffset}" ViewportSize="{TemplateBinding ViewportHeight}" Width="18" Style="{TemplateBinding c1:ClearStyleExtensions.ScrollBarStyle}" Background="{TemplateBinding c1:ClearStyleExtensions.ButtonBackground}" Foreground="{TemplateBinding c1:ClearStyleExtensions.ButtonForeground}" BorderBrush="{TemplateBinding BorderBrush}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" c1:ClearStyleExtensions.CornerRadius="{Binding Output,ElementName=verticalRadiusBuilder}" />
                            <ScrollBar x:Name="PART_HorizontalScrollBar" Grid.Column="0" Height="18" IsTabStop="False" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{TemplateBinding HorizontalOffset}" ViewportSize="{TemplateBinding ViewportWidth}" Style="{TemplateBinding c1:ClearStyleExtensions.ScrollBarStyle}" Background="{TemplateBinding c1:ClearStyleExtensions.ButtonBackground}" Foreground="{TemplateBinding c1:ClearStyleExtensions.ButtonForeground}" BorderBrush="{TemplateBinding BorderBrush}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" c1:ClearStyleExtensions.CornerRadius="{Binding Output,ElementName=horizontalRadiusBuilder}" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
