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

    <SolidColorBrush x:Key="ToolbarBackground" Color="#FFF0F3F5" />

    <c1:VisibilityConverter x:Key="boolToVisibility" />
    <c1:C1SideThicknessConverter x:Key="sideThicknessConverter" />

    <!-- C1TabItemBorder -->
    <Style x:Key="C1TabItemBorder" TargetType="c1:C1TabItemBorder">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1:C1TabItemBorder">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ShapeStates">
                                <VisualState x:Name="Rectangle">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangled" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Rounded">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rounded" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Sloped">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="sloped" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Ribbon">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ribbon" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="sloped" ClipToBounds="True" Visibility="Collapsed" >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid x:Name="leftTriangle" Width="18">
                                <Path Data="M0,20 L24.5,7.27 C26.8,6 30,4.8 34,4.8 L36,4.77 L36,20" Stretch="Fill" Margin="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=top}" Fill="{TemplateBinding Background}" />
                                <Path Data="M0,20 L24.5,7.27 C26.8,6 30,4.8 34,4.8 L36,4.77" Stretch="Fill" StrokeStartLineCap="Triangle" StrokeEndLineCap="Triangle" Margin="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource slopedBorderAdjustConverter}}" StrokeThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource projectThicknessConverter}, ConverterParameter=top}" Stroke="{TemplateBinding BorderBrush}" />
                            </Grid>
                            <Border Grid.Column="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Padding="0,0,8,0" CornerRadius="0,3,0,0"
                                    BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=top-right}" SnapsToDevicePixels="True">
                                <ContentPresenter />
                            </Border>
                        </Grid>
                        <Border x:Name="rectangled" Visibility="Collapsed" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Padding="8,0"
                                BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}}" SnapsToDevicePixels="True">
                            <ContentPresenter />
                        </Border>
                        <Border x:Name="rounded" Visibility="Collapsed" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Padding="8,0"
                                CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideRadiusConverter}, ConverterParameter='topright-topleft'}"
                                BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}}" SnapsToDevicePixels="True">
                            <ContentPresenter />
                        </Border>
                        <Grid x:Name="ribbon" Visibility="Collapsed">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <!-- Ribbon -->
                            <Grid x:Name="leftRibbon" Grid.Column="0" Width="8">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition Height="7" />
                                    </Grid.RowDefinitions>
                                    <Border Grid.RowSpan="2" Background="{TemplateBinding Background}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-top}" CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideRadiusConverter}, ConverterParameter=topleft}" />
                                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-top}" CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideRadiusConverter}, ConverterParameter=topleft}" />
                                </Grid>
                                <Border Width="8" Height="8" HorizontalAlignment="Left" VerticalAlignment="Bottom" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-top}" CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideRadiusConverter}, ConverterParameter=topleft}">
                                    <Border.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform ScaleX="-1" ScaleY="-1" />
                                            <TranslateTransform X="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource projectThicknessConverter}, ConverterParameter=left}" />
                                            <TranslateTransform Y="8" />
                                            <TranslateTransform Y="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource projectThicknessConverter}, ConverterParameter=top}" />
                                        </TransformGroup>
                                    </Border.RenderTransform>
                                    <UIElement.Clip>
                                        <RectangleGeometry Rect="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource tabItemBorderClipConverter}}" />
                                    </UIElement.Clip>
                                </Border>
                            </Grid>
                            <Grid x:Name="rightRibbon" Grid.Column="2" Width="8">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition Height="7" />
                                    </Grid.RowDefinitions>
                                    <Border Grid.RowSpan="2" Background="{TemplateBinding Background}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=right-top}" CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideRadiusConverter}, ConverterParameter=topright}" />
                                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=right-top}" CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideRadiusConverter}, ConverterParameter=topright}" />
                                </Grid>
                                <Border Width="8" Height="8" HorizontalAlignment="Right" VerticalAlignment="Bottom" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=right-top}" CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideRadiusConverter}, ConverterParameter=topright}">
                                    <Border.RenderTransform>
                                        <TransformGroup>
                                            <TranslateTransform X="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource projectThicknessConverter}, ConverterParameter=right}" />
                                            <ScaleTransform ScaleX="-1" ScaleY="-1" />
                                            <TranslateTransform X="16" />
                                            <TranslateTransform Y="8" />
                                            <TranslateTransform Y="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource projectThicknessConverter}, ConverterParameter=top}" />
                                        </TransformGroup>
                                    </Border.RenderTransform>
                                    <UIElement.Clip>
                                        <RectangleGeometry Rect="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource tabItemBorderClipConverter}}" />
                                    </UIElement.Clip>
                                </Border>
                            </Grid>

                            <!-- Middle Element -->
                            <Border Grid.Column="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=top}" SnapsToDevicePixels="True">
                                <ContentPresenter />
                            </Border>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1TabItemPresenter -->
    <Style x:Key="C1ToolbarTabItemPresenter" TargetType="c1:C1TabItemPresenter">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1:C1TabItemPresenter">
                    <Grid x:Name="Container" VerticalAlignment="Bottom">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="SelectedElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <!--<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InnerBorderElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>-->
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ContentBorder" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="MiddleGrid" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InnerBorderMouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="TabStripPlacementStates">
                                <VisualState x:Name="TopTabStripPlacement">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="BottomTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterTransformer" Storyboard.TargetProperty="LayoutTransform">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <ScaleTransform ScaleY="-1" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerTransformer" Storyboard.TargetProperty="LayoutTransform">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <ScaleTransform ScaleY="-1" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Container" Storyboard.TargetProperty="VerticalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <VerticalAlignment>Top</VerticalAlignment>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="LeftTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterTransformer" Storyboard.TargetProperty="LayoutTransform">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <TransformGroup>
                                                        <ScaleTransform ScaleY="-1" />
                                                        <RotateTransform Angle="90" />
                                                    </TransformGroup>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerTransformer" Storyboard.TargetProperty="LayoutTransform">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <ScaleTransform ScaleY="-1" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Container" Storyboard.TargetProperty="HorizontalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <HorizontalAlignment>Right</HorizontalAlignment>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="RightTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="OuterTransformer" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>-1 0 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterTransformer" Storyboard.TargetProperty="LayoutTransform">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <RotateTransform Angle="90" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Container" Storyboard.TargetProperty="HorizontalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <HorizontalAlignment>Left</HorizontalAlignment>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1LayoutTransformer x:Name="OuterTransformer">
                            <Grid Margin="0 0 0 1" x:Name="MiddleGrid">
                                <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{Binding Path=Background, RelativeSource={RelativeSource TemplatedParent}}" DesignBrush="{StaticResource DockItemBackgroundBrush}" DesignColor="{StaticResource BaseColor}" />
                                <!--<c1:C1BrushBuilder x:Name="MouseOverBrush" Input="{Binding Path=MouseOverBrush, RelativeSource={RelativeSource TemplatedParent}}" DesignBrush="{StaticResource DockItemBackgroundOverBrush}" DesignColor="{StaticResource MouseOverColor}"/>-->
                                <!--<c1:C1BrushBuilder x:Name="InnerBorderBrush" Input="{Binding Path=Background, RelativeSource={RelativeSource TemplatedParent}}" DesignBrush="{StaticResource InnerBorderBrush}" DesignColor="{StaticResource BaseColor}"/>-->
                                <c1:C1BrushBuilder x:Name="InnerBorderMouseOverBrush" Input="{Binding Path=MouseOverBrush, RelativeSource={RelativeSource TemplatedParent}}" DesignBrush="{StaticResource InnerBorderMouseOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
                                <c1:C1TabItemBorder x:Name="BackgroundElement" Style="{StaticResource C1TabItemBorder}" Shape="{TemplateBinding TabShape}" Background="{Binding ElementName=BackgroundBrush, Path=Output}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" />
                                <!--{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-top-right}-->
                                <!--<c1:C1TabItemBorder x:Name="InnerBorderElement"
                                                    Shape="{TemplateBinding TabShape}"
                                                    Margin="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-top-right}"
                                                    BorderBrush="{Binding ElementName=InnerBorderBrush, Path=Output}"
                                                    BorderThickness="1 1 1 0"
                                                    CornerRadius="{TemplateBinding CornerRadius}"/>-->
                                <c1:C1TabItemBorder x:Name="SelectedElement" Style="{StaticResource C1TabItemBorder}" Shape="{TemplateBinding TabShape}" Background="{TemplateBinding SelectedBackground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1 1 1 0" CornerRadius="{TemplateBinding CornerRadius}" Visibility="Collapsed" />
                                <c1:C1TabItemBorder x:Name="MouseOverElement" Style="{StaticResource C1TabItemBorder}" Shape="{TemplateBinding TabShape}" Background="{TemplateBinding MouseOverBrush}" BorderBrush="Transparent" BorderThickness="1 1 1 0" CornerRadius="{TemplateBinding CornerRadius}" Visibility="Collapsed" />
                                <c1:C1TabItemBorder x:Name="InnerBorderMouseOverElement" Opacity="0.7" Style="{StaticResource C1TabItemBorder}" Shape="{TemplateBinding TabShape}" Margin="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-top-right}" BorderBrush="{Binding ElementName=InnerBorderMouseOverBrush, Path=Output}" BorderThickness="1 1 1 0" CornerRadius="{TemplateBinding CornerRadius}" Visibility="Collapsed" />
                                <c1:C1TabItemBorder Shape="{TemplateBinding TabShape}" Style="{StaticResource C1TabItemBorder}" CornerRadius="{TemplateBinding CornerRadius}">
                                    <c1:C1LayoutTransformer x:Name="InnerTransformer" Margin="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}}">
                                        <Border x:Name="ContentBorder">
                                            <c1:C1LayoutRounder Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                                        </Border>
                                    </c1:C1LayoutTransformer>
                                </c1:C1TabItemBorder>
                            </Grid>
                        </c1:C1LayoutTransformer>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- @ c1:C1TabItem Default Style-->
    <Style TargetType="c1tb:C1ToolbarTabItem">
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrushColor}" />
        <Setter Property="Padding" Value="2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1tb:C1ToolbarTabItem">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="TabStripPlacementStates">
                                <VisualState x:Name="LeftTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="C1TabItemPresenter" Storyboard.TargetProperty="TabStripPlacement">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <c1:Dock>Left</c1:Dock>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="TopTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="C1TabItemPresenter" Storyboard.TargetProperty="TabStripPlacement">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <c1:Dock>Top</c1:Dock>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="RightTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="C1TabItemPresenter" Storyboard.TargetProperty="TabStripPlacement">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <c1:Dock>Right</c1:Dock>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BottomTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="C1TabItemPresenter" Storyboard.TargetProperty="TabStripPlacement">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <c1:Dock>Bottom</c1:Dock>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1TabItemPresenter x:Name="C1TabItemPresenter" IsSelected="{TemplateBinding IsSelected}" TabShape="{TemplateBinding TabShape}" CornerRadius="4" BorderThickness="{Binding BorderThickness, ConverterParameter=left-top-right, Converter={StaticResource sideThicknessConverter}, RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" Background="Transparent" MouseOverBrush="{TemplateBinding MouseOverBrush}" SelectedBackground="{TemplateBinding SelectedBackground}" PressedBrush="{TemplateBinding PressedBrush}" Padding="{TemplateBinding Padding}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Style="{StaticResource C1ToolbarTabItemPresenter}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <ContentPresenter Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                <Button x:Name="CloseButton" Grid.Column="1" Height="15" Width="15" Style="{StaticResource ClearStyleButtonStyle}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.CornerRadius="0" Background="Transparent" Foreground="{TemplateBinding Foreground}" BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 0 -6 0" ToolTipService.ToolTip="{Binding Path=Close, Source={StaticResource Resources}}">
                                    <c1:C1PathIcon Data="M0,0 L1.6,0 L3,1.56 L4.4,0 L6,0 L3.8,2.5 L6,5 L4.4,5 L3,3.49 L1.59,5 L-4.2E-09,5 L2.18,2.5 z" Width="7" Height="6" StrokeThickness="1" Foreground="{TemplateBinding Foreground}" />
                                </Button>
                            </Grid>
                        </c1:C1TabItemPresenter>

                        <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Button used in controls with ClearStyle -->
    <Style x:Key="ClearStyleButtonStyle" TargetType="ButtonBase">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ButtonBase">
                    <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" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckedElement" 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="Unchecked" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}" DesignBrush="{StaticResource GeneralGradientBrush}" DesignColor="{StaticResource BaseColor}" />
                        <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}" />
                        <c1:C1BrushBuilder x:Name="CheckedBrush" Input="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" DesignBrush="{StaticResource GeneralGradientCheckedBrush}" DesignColor="{StaticResource SelectedColor}" />
                        <c1:C1BrushBuilder x:Name="InnerBorderBrush" Input="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}" DesignBrush="{StaticResource InnerBorderBrush}" DesignColor="{StaticResource BaseColor}" />
                        <c1:C1BrushBuilder x:Name="InnerBorderMouseOverBrush" Input="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" DesignBrush="{StaticResource InnerBorderMouseOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
                        <c1:C1BrushBuilder x:Name="InnerBorderPressedBrush" Input="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" DesignBrush="{StaticResource InnerBorderPressedBrush}" DesignColor="{StaticResource SelectedColor}" />
                        <Border x:Name="BackgroundElement" Background="{Binding Output, ElementName=BackgroundBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}">
                            <Border BorderBrush="{Binding Output, ElementName=InnerBorderBrush}" BorderThickness="{StaticResource InnerBorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" />
                        </Border>
                        <Border x:Name="CheckedElement" Background="{Binding Output, ElementName=CheckedBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed" />
                        <Border x:Name="MouseOverElement" Background="{Binding Output, ElementName=MouseOverBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed">
                            <Border BorderBrush="{Binding Output, ElementName=InnerBorderMouseOverBrush}" BorderThickness="{StaticResource InnerBorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" />
                        </Border>
                        <Border x:Name="PressedElement" Background="{Binding Output, ElementName=PressedBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed">
                            <Border BorderBrush="{Binding Output, ElementName=InnerBorderPressedBrush}" BorderThickness="{StaticResource InnerBorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" />
                        </Border>

                        <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                        <Border x:Name="FocusVisualElement" BorderBrush="{TemplateBinding c1:ClearStyleExtensions.FocusBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" IsHitTestVisible="false" Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- @ C1ToolbarExpandButton -->
    <Style x:Key="C1ToolbarExpandButtonStyle" TargetType="ButtonBase">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ButtonBase">
                    <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" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="contentPresenter" Duration="00:00:00.2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="180" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="contentPresenter" Duration="00:00:00.2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}" DesignBrush="{StaticResource GeneralGradientBrush}" DesignColor="{StaticResource BaseColor}" />
                        <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}" />
                        <c1:C1BrushBuilder x:Name="InnerBorderBrush" Input="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}" DesignBrush="{StaticResource InnerBorderBrush}" DesignColor="{StaticResource BaseColor}" />
                        <c1:C1BrushBuilder x:Name="InnerBorderMouseOverBrush" Input="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" DesignBrush="{StaticResource InnerBorderMouseOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
                        <c1:C1BrushBuilder x:Name="InnerBorderPressedBrush" Input="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" DesignBrush="{StaticResource InnerBorderPressedBrush}" DesignColor="{StaticResource SelectedColor}" />
                        <Border x:Name="BackgroundElement" Background="{Binding Output, ElementName=BackgroundBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}">
                            <Border BorderBrush="{Binding Output, ElementName=InnerBorderBrush}" BorderThickness="{StaticResource InnerBorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" />
                        </Border>
                        <Border x:Name="MouseOverElement" Background="{Binding Output, ElementName=MouseOverBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed">
                            <Border BorderBrush="{Binding Output, ElementName=InnerBorderMouseOverBrush}" BorderThickness="{StaticResource InnerBorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" />
                        </Border>
                        <Border x:Name="PressedElement" Background="{Binding Output, ElementName=PressedBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed">
                            <Border BorderBrush="{Binding Output, ElementName=InnerBorderPressedBrush}" BorderThickness="{StaticResource InnerBorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" />
                        </Border>
                        <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" RenderTransformOrigin="0.5,0.5">
                            <ContentPresenter.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform />
                                    <SkewTransform />
                                    <RotateTransform />
                                    <TranslateTransform />
                                </TransformGroup>
                            </ContentPresenter.RenderTransform>
                        </ContentPresenter>
                        <Border x:Name="FocusVisualElement" BorderBrush="{TemplateBinding c1:ClearStyleExtensions.FocusBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" IsHitTestVisible="false" Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!-- @ c1:C1TabControl Default Style-->
    <Style TargetType="c1tb:C1ToolbarTabControl">
        <Setter Property="Background" Value="{StaticResource BaseColorBrush}" />
        <Setter Property="MouseOverBrush" Value="{StaticResource MouseOverBrush}" />
        <Setter Property="PressedBrush" Value="{StaticResource SelectedBackground}" />
        <Setter Property="SelectedBackground" Value="{StaticResource ToolbarBackground}" />
        <Setter Property="TabStripBackground" Value="{StaticResource BaseColorBrush}" />
        <Setter Property="TabStripForeground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}" />
        <Setter Property="TabStripOverlap" Value="0" />
        <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="TabItemShape" Value="Rounded" />
        <Setter Property="TabStripPlacement" Value="Top" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1tb:C1ToolbarTabControl">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="TabStripPlacementStates">
                                <VisualState x:Name="BottomTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TabPanelPresenter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>8 -1 8 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="LeftTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="TabPanelPresenter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 8 -1 8</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="TabPanel" Storyboard.TargetProperty="Orientation">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Orientation>Vertical</Orientation>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LineOuter" Storyboard.TargetProperty="Orientation">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Orientation>Horizontal</Orientation>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LineOuter" Storyboard.TargetProperty="Reverse">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <system:Boolean>False</system:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LineTabItems" Storyboard.TargetProperty="Orientation">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Orientation>Vertical</Orientation>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PreviousButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="90" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="NextButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="90" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="TopTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TabPanelPresenter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>8 0 8 -1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LineOuter" Storyboard.TargetProperty="Reverse">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <system:Boolean>False</system:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="RightTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TabPanelPresenter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>8 0 8 -1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TabPanel" Storyboard.TargetProperty="Orientation">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Orientation>Vertical</Orientation>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LineOuter" Storyboard.TargetProperty="Orientation">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Orientation>Horizontal</Orientation>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LineTabItems" Storyboard.TargetProperty="Orientation">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Orientation>Vertical</Orientation>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PreviousButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="90" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="NextButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="90" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ShapeStates">
                                <VisualState x:Name="Rectangle" />
                                <VisualState x:Name="Rounded" />
                                <VisualState x:Name="Sloped" />
                                <VisualState x:Name="Ribbon">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LeftFilling" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RightFilling" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource ToolbarBackground}" DesignColor="{StaticResource BaseColor}" />
                        <c1:C1LinePanel x:Name="LineOuter" Margin="{TemplateBinding Padding}" Orientation="Vertical" Reverse="True">
                            <c1:C1LinePanel.LineDefinitions>
                                <c1:LineDefinition Length="Auto" />
                                <c1:LineDefinition Length="*" />
                            </c1:C1LinePanel.LineDefinitions>

                            <!-- Tab Items section -->
                            <!-- Put tab items before content so tab key navigation finds the items first. -->
                            <c1:C1LinePanel Canvas.ZIndex="100" x:Name="LineTabItems" Orientation="Horizontal" Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShowTabs, Converter={StaticResource visibilityConverter}}">
                                <c1:C1LinePanel.LineDefinitions>
                                    <c1:LineDefinition Length="Auto" />
                                    <c1:LineDefinition Length="Auto" />
                                    <c1:LineDefinition Length="*" />
                                    <c1:LineDefinition Length="Auto" />
                                    <c1:LineDefinition Length="Auto" />
                                    <c1:LineDefinition Length="Auto" />
                                    <c1:LineDefinition Length="Auto" />
                                    <c1:LineDefinition Length="Auto" />
                                    <c1:LineDefinition Length="Auto" />
                                </c1:C1LinePanel.LineDefinitions>

                                <Border x:Name="LeftFilling" Visibility="Collapsed" Width="8" Height="8" />

                                <!-- Previous -->
                                <RepeatButton x:Name="PreviousButton" Height="15" Width="15" Style="{StaticResource ClearStyleButtonStyle}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.CornerRadius="0" Background="{TemplateBinding TabStripBackground}" Foreground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="2" RenderTransformOrigin="0.5,0.5" ToolTipService.ToolTip="{Binding Path=Previous, Source={StaticResource Resources}}">
                                    <RepeatButton.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform />
                                            <SkewTransform />
                                            <RotateTransform />
                                            <TranslateTransform />
                                        </TransformGroup>
                                    </RepeatButton.RenderTransform>
                                    <c1:C1PathIcon Data="M5.3,1E-07 L7,1E-07 L4.7,2.5 L7,5 L5.3,5 L3,2.5 z M2.3,0 L4,0 L1.7,2.5 L4,5 L2.3,5 L0,2.5 z" Width="7" Height="5" StrokeThickness="1" Foreground="{TemplateBinding TabStripForeground}" />
                                </RepeatButton>
                                <!-- TabPanel -->
                                <ContentPresenter x:Name="TabPanelPresenter" Grid.Column="1">
                                    <ContentPresenter.Content>
                                        <c1:C1TabPanel x:Name="TabPanel" Orientation="Horizontal" HorizontalAlignment="{TemplateBinding TabStripHorizontalAlignment}" VerticalAlignment="{TemplateBinding TabStripVerticalAlignment}" />
                                    </ContentPresenter.Content>
                                </ContentPresenter>
                                <!-- Next -->
                                <RepeatButton x:Name="NextButton" Grid.Column="3" Height="15" Width="15" Style="{StaticResource ClearStyleButtonStyle}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.CornerRadius="0" Background="{TemplateBinding TabStripBackground}" Foreground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="2" RenderTransformOrigin="0.5,0.5" ToolTipService.ToolTip="{Binding Path=Next, Source={StaticResource Resources}}">
                                    <RepeatButton.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform />
                                            <SkewTransform />
                                            <RotateTransform />
                                            <TranslateTransform />
                                        </TransformGroup>
                                    </RepeatButton.RenderTransform>
                                    <c1:C1PathIcon Data="M3,0 L4.67,0 L7,2.5 L4.67,5 L3,5 L5.3,2.5 z M0,0 L1.67,0 L4,2.5 L1.67,5 L0,5 L2.3,2.5 z" Width="7" Height="5" StrokeThickness="1" Foreground="{TemplateBinding TabStripForeground}" />
                                </RepeatButton>
                                <!-- TabStripMenu  -->
                                <c1:C1DropDownButton x:Name="TabStripDropDown" Height="15" Width="15" Margin="2" AutoClose="True" MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.CornerRadius="0" Background="{TemplateBinding TabStripBackground}" Foreground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Visibility="{TemplateBinding TabStripMenuVisibility}" ToolTipService.ToolTip="{Binding Path=Menu, Source={StaticResource Resources}}" Style="{StaticResource TabStripDropDown}">
                                    <c1:C1DropDownButton.Header>
                                        <Grid Width="7" Height="4" Margin="0 5 0 0" VerticalAlignment="Top">
                                            <Polygon Points="0,0 3.5,3.5 7,0" Fill="{TemplateBinding TabStripForeground}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                            <Rectangle Height="1" Margin="0,-2,0,0" Fill="{TemplateBinding TabStripForeground}" StrokeThickness="0" VerticalAlignment="Top" />
                                        </Grid>
                                    </c1:C1DropDownButton.Header>
                                    <c1:C1MenuList x:Name="Menu" Padding="0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding TabStripBackground}" HighlightedBackground="{TemplateBinding MouseOverBrush}" OpenedBackground="{TemplateBinding PressedBrush}" Foreground="{TemplateBinding TabStripForeground}" />
                                </c1:C1DropDownButton>

                                <!-- Close -->
                                <Button x:Name="CloseButton" Grid.Column="5" Grid.Row="5" Height="15" Width="15" Margin="2 2 4 2" VerticalAlignment="Center" Style="{StaticResource ClearStyleButtonStyle}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.CornerRadius="0" Background="{TemplateBinding TabStripBackground}" Foreground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" ToolTipService.ToolTip="{Binding Path=CloseGlobal, Source={StaticResource Resources}}">
                                    <c1:C1PathIcon Data="M0,0 L1.6,0 L3,1.56 L4.4,0 L6,0 L3.8,2.5 L6,5 L4.4,5 L3,3.49 L1.59,5 L-4.2E-09,5 L2.18,2.5 z" Width="7" Height="6" StrokeThickness="1" Foreground="{TemplateBinding TabStripForeground}" />
                                </Button>

                                <!-- Collapse/Expand -->
                                <ToggleButton x:Name="CollapseButton" Style="{StaticResource C1ToolbarExpandButtonStyle}" Background="Transparent" BorderThickness="0" Height="22" Width="22">
                                    <c1:C1PathIcon Data="M5.0145311,0 L9.2833071,4.4663367 C9.2833071,4.4663367 9.6584311,4.8817816 9.6584311,4.8817816 C9.8740797,5.2009835 10,5.5857868 10,6.0000005 C10,7.1045699 9.1045694,8 8,8 C7.4477153,8 6.9477153,7.7761431 6.5857863,7.4142141 L6.5560269,7.3830004 L6.5534911,7.3830004 L5.0066848,5.7530007 L3.4501808,7.3830004 L3.4439728,7.3830004 L3.4142137,7.4142141 C3.0522847,7.7761431 2.5522847,8 2,8 C0.89543051,8 0,7.1045699 0,6.0000005 C0,5.5857868 0.12591991,5.2009835 0.34156859,4.8817816 L0.36416888,4.8499999 C0.36416888,4.8499999 0.62903774,4.5382209 0.72781432,4.4567032 L0.72962582,4.4552794 z" StrokeThickness="1" Foreground="#FF505860" Background="#FFE4DEC7" Height="8" Width="10" />

                                </ToggleButton>
                                <!-- Help -->
                                <Button x:Name="HelpButton" Style="{StaticResource ClearStyleButtonStyle}" Background="Transparent" BorderThickness="0" Height="22" Width="22">
                                    <Grid >
                                        <c1:C1PathIcon Data="M54.8796844,443.0591 L54.8796844,445 L57.2307692,445 L57.2307692,443.0591 Z M56,448 C51.5817218,448 48,444.418278 48,440 C48,435.581722 51.5817218,432 56,432 C60.4182782,432 64,435.581722 64,440 C64,444.418278 60.4182782,448 56,448 Z M53.5700197,435.51041 C52.5864514,436.043208 52.0631167,436.947609 52,438.22364 L54.2800789,438.22364 C54.2800789,437.852024 54.4076253,437.493845 54.6627219,437.149093 C54.9178185,436.804341 55.3504243,436.631968 55.9605523,436.631968 C56.5811997,436.631968 57.0085458,436.771881 57.2426036,437.051713 C57.4766613,437.331544 57.5936884,437.641592 57.5936884,437.981867 C57.5936884,438.277369 57.4884955,438.548241 57.2781065,438.794493 L56.8205128,439.190732 L56.2445759,439.573539 C55.6765258,439.949633 55.3241295,440.282067 55.1873767,440.570853 C55.0506239,440.859639 54.9664696,441.382356 54.9349112,442.139019 L57.0650888,442.139019 C57.0703485,441.780835 57.1045362,441.516679 57.1676529,441.346541 C57.2675876,441.077903 57.4700839,440.842849 57.7751479,440.64137 L58.3353057,440.271995 C58.9033559,439.895901 59.28731,439.586972 59.4871795,439.345198 C59.8290615,438.946718 60,438.456461 60,437.874412 C60,436.925225 59.6068415,436.208867 58.8205128,435.725319 C58.0341841,435.241771 57.0466858,435 55.8579882,435 C54.9533157,435 54.1906671,435.170135 53.5700197,435.51041 Z M53.5700197,435.51041" StrokeThickness="1" Foreground="#FF6090D0" Background="#FFFFFFFF" Height="16" Width="16" HorizontalAlignment="Center" />
                                    </Grid>
                                </Button>

                                <Border x:Name="RightFilling" Visibility="Collapsed" Width="8" Height="8" />
                            </c1:C1LinePanel>

                            <Border x:Name="SelectedItemContentBorder" Background="{Binding ElementName=BackgroundBrush, Path=Output}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                                <ContentPresenter x:Name="SelectedItemContent" ContentTemplate="{x:Null}" />
                            </Border>

                        </c1:C1LinePanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
