<ResourceDictionary 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:c1="using:C1.Xaml">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ms-appx:///C1.UWP/themes/Common.xaml"/>
        <ResourceDictionary Source="ms-appx:///C1.UWP/themes/C1Button.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary x:Key="Default">
            <SolidColorBrush x:Key="TabControlBackgroundThemeBrush" Color="#FF5D5D5D"/>
            <SolidColorBrush x:Key="TabControlForegroundThemeBrush" Color="White"/>
            <SolidColorBrush x:Key="TabControlTabStripBackgroundThemeBrush" Color="#FF3A3A3A"/>
            <SolidColorBrush x:Key="TabControlTabStripForegroundThemeBrush" Color="White"/>
            <SolidColorBrush x:Key="TabControlPointerOverBackgroundThemeBrush" Color="#FF545454"/>
            <SolidColorBrush x:Key="TabControlSelectedBackgroundThemeBrush" Color="#FF5D5D5D"/>
            <SolidColorBrush x:Key="TabControlBorderThemeBrush" Color="#FF5D5D5D"/>
            <Thickness x:Key="TabControlBorderThemeThickness">2</Thickness>
        </ResourceDictionary>
        <ResourceDictionary x:Key="Light">
            <SolidColorBrush x:Key="TabControlBackgroundThemeBrush" Color="#FFE8E8E8"/>
            <SolidColorBrush x:Key="TabControlForegroundThemeBrush" Color="Black"/>
            <SolidColorBrush x:Key="TabControlTabStripBackgroundThemeBrush" Color="White"/>
            <SolidColorBrush x:Key="TabControlTabStripForegroundThemeBrush" Color="Black"/>
            <SolidColorBrush x:Key="TabControlPointerOverBackgroundThemeBrush" Color="#FFD4D4D4"/>
            <SolidColorBrush x:Key="TabControlSelectedBackgroundThemeBrush" Color="#FFE8E8E8"/>
            <SolidColorBrush x:Key="TabControlBorderThemeBrush" Color="#FFE8E8E8"/>
            <Thickness x:Key="TabControlBorderThemeThickness">2</Thickness>
        </ResourceDictionary>
        <ResourceDictionary x:Key="HighContrast">
            <SolidColorBrush x:Key="TabControlBackgroundThemeBrush" Color="Black"/>
            <SolidColorBrush x:Key="TabControlForegroundThemeBrush" Color="Yellow"/>
            <SolidColorBrush x:Key="TabControlTabStripBackgroundThemeBrush" Color="Black"/>
            <SolidColorBrush x:Key="TabControlTabStripForegroundThemeBrush" Color="White"/>
            <SolidColorBrush x:Key="TabControlPointerOverBackgroundThemeBrush" Color="#FF1AEBFF"/>
            <SolidColorBrush x:Key="TabControlSelectedBackgroundThemeBrush" Color="#FF008000"/>
            <SolidColorBrush x:Key="TabControlBorderThemeBrush" Color="White"/>
            <Thickness x:Key="TabControlBorderThemeThickness">2</Thickness>
        </ResourceDictionary>
        <ResourceDictionary x:Key="HighContrastBlack">
            <SolidColorBrush x:Key="TabControlBackgroundThemeBrush" Color="Black"/>
            <SolidColorBrush x:Key="TabControlForegroundThemeBrush" Color="White"/>
            <SolidColorBrush x:Key="TabControlTabStripBackgroundThemeBrush" Color="Black"/>
            <SolidColorBrush x:Key="TabControlTabStripForegroundThemeBrush" Color="White"/>
            <SolidColorBrush x:Key="TabControlPointerOverBackgroundThemeBrush" Color="#FF1AEBFF"/>
            <SolidColorBrush x:Key="TabControlSelectedBackgroundThemeBrush" Color="#FF008000"/>
            <SolidColorBrush x:Key="TabControlBorderThemeBrush" Color="White"/>
            <Thickness x:Key="TabControlBorderThemeThickness">2</Thickness>
        </ResourceDictionary>
        <ResourceDictionary x:Key="HighContrastWhite">
            <SolidColorBrush x:Key="TabControlBackgroundThemeBrush" Color="White"/>
            <SolidColorBrush x:Key="TabControlForegroundThemeBrush" Color="Black"/>
            <SolidColorBrush x:Key="TabControlTabStripBackgroundThemeBrush" Color="White"/>
            <SolidColorBrush x:Key="TabControlTabStripForegroundThemeBrush" Color="Black"/>
            <SolidColorBrush x:Key="TabControlPointerOverBackgroundThemeBrush" Color="#FF37006E"/>
            <SolidColorBrush x:Key="TabControlSelectedBackgroundThemeBrush" Color="#CC37006E"/>
            <SolidColorBrush x:Key="TabControlBorderThemeBrush" Color="White"/>
            <Thickness x:Key="TabControlBorderThemeThickness">2</Thickness>
        </ResourceDictionary>
    </ResourceDictionary.ThemeDictionaries>

    <!--******************* C1TabControl *******************-->

    <Style x:Key="NavigationButtonCloseStyle" TargetType="ButtonBase">
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="0 2 0 0"/>
        <Setter Property="FontSize" Value="{ThemeResource ComboBoxArrowThemeFontSize}"/>
        <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="Margin" Value="0"/>
    </Style>
    <Style x:Key="NavigationButtonStyle" TargetType="ButtonBase">
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="0 -2 0 0"/>
        <Setter Property="FontSize" Value="{ThemeResource ComboBoxArrowThemeFontSize}"/>
        <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="Margin" Value="0"/>
    </Style>
    <Style TargetType="TextBlock" x:Key="TextIconStyle">
        <Setter Property="FontSize" Value="20" />
        <Setter Property="FontFamily" Value="Segoe UI Symbol" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Center" />
    </Style>
    <!-- TabStripDropDown -->
    <Style x:Key="TabStripDropDown" TargetType="c1:C1DropDownButton">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1:C1DropDownButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="DropDownOpenStates">
                                <VisualState x:Name="Closed" />
                                <VisualState x:Name="Opened" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled" />
                                <VisualState x:Name="MouseOver" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <ToggleButton x:Name="ArrowToggle" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Style="{StaticResource NavigationButtonStyle}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.CornerRadius="0" Background="{TemplateBinding Background}" Foreground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" VerticalContentAlignment="Bottom" HorizontalContentAlignment="Center" Padding="0" IsTabStop="True">
                            <ContentPresenter Content="{TemplateBinding Header}" Margin="{TemplateBinding HeaderPadding}" />
                        </ToggleButton>
                        <Popup x:Name="DropDownPopup" Grid.Row="1">
                            <Grid Height="{TemplateBinding DropDownHeight}" Width="{TemplateBinding DropDownWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}" MaxWidth="{TemplateBinding MaxDropDownWidth}" MinWidth="{TemplateBinding MinDropDownWidth}">
                                <ContentPresenter Margin="{TemplateBinding Padding}" />
                            </Grid>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- C1TabItemBorder -->
    <Style 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="leftRectangle" 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="rightRectangle" 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="leftRounded" 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="rightRounded" 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="leftTriangle" 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="rightTriangle" 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="leftRibbon" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rightRibbon" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <!-- Sloped -->
                            <Grid x:Name="leftTriangle" Visibility="Collapsed" Width="18">
                                <Path Visibility="Collapsed" Data="M0,20 L24.5,7.27 C26.8,6 30,4.8 34,4.8 L36,4.77 L36,20" Stretch="Fill" Fill="{TemplateBinding Background}" />
                                <Path Visibility="Collapsed" Data="M0,20 L24.5,7.27 C26.8,6 30,4.8 34,4.8 L36,4.77" Stretch="Fill" StrokeThickness="{TemplateBinding BorderThickness}" Stroke="{TemplateBinding BorderBrush}" />
                                <Path Data="M-1.40625,20 L21.664,7.51405 C23.964,6.24405 26.064,4.8201 34,4.8 L36,4.77 L36,20" Stretch="Fill" Fill="{TemplateBinding Background}" Margin="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-top}" UseLayoutRounding="False" />
                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-top}" Width="20" CornerRadius="4" RenderTransformOrigin="1,0.5" Margin="0,0,13,-2">
                                    <Border.RenderTransform>
                                        <CompositeTransform Rotation="2" TranslateX="7" SkewX="-13" SkewY="-6" TranslateY="-1" ScaleY="0.99"/>
                                    </Border.RenderTransform>
                                </Border>
                            </Grid>
                            <Border x:Name="rightTriangle" Grid.Column="2" Visibility="Collapsed" CornerRadius="0,3,0,0" Width="8" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=top-right}" UseLayoutRounding="True" />
                            <!-- Rectangle -->
                            <Border x:Name="leftRectangle" Grid.Column="0" Visibility="Collapsed" Width="8" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-top}" UseLayoutRounding="True" />
                            <Border x:Name="rightRectangle" Grid.Column="2" Visibility="Collapsed" Width="8" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=top-right}" UseLayoutRounding="True" />
                            <!-- Rounded -->
                            <Border x:Name="leftRounded" Grid.Column="0" Visibility="Collapsed" Width="8" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-top}" CornerRadius="4 0 0 0" UseLayoutRounding="True" />
                            <Border x:Name="rightRounded" Grid.Column="2" Visibility="Collapsed" Width="8" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=top-right}" CornerRadius="0 4 0 0"  UseLayoutRounding="True" />
                            <!-- Ribbon -->
                            <Grid x:Name="leftRibbon" Grid.Column="0" Visibility="Collapsed" Width="8">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition Height="8" />
                                    </Grid.RowDefinitions>
                                    <Border Grid.RowSpan="2" 
                                         Background="{TemplateBinding Background}"
                                         BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-top}"
                                         CornerRadius="4 0 0 0"/>
                                    <Border BorderBrush="{TemplateBinding BorderBrush}"
                                         BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-top}"
                                         CornerRadius="4 0 0 0"/>
                                    <Border Grid.Row="2" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left-right}" BorderBrush="{TemplateBinding BorderBrush}" HorizontalAlignment="Left" Height="16" Grid.RowSpan="2" Width="16" CornerRadius="8" VerticalAlignment="Bottom" RenderTransformOrigin="0,0.5" Margin="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left}">
                                        <Border.RenderTransform>
                                            <CompositeTransform ScaleX="-1"/>
                                        </Border.RenderTransform>
                                    </Border>
                                </Grid>
                                <Path  Grid.Row="1" Data="M50,50 C50.0021,50.7615 16.6667,50 0,50 L-1.60044,49.8028 L-2.03497,1.26915 C8.18618,44.6677 45.354,43.9063 50,50 z" 
					                Fill="{TemplateBinding Background}" 
					                Height="8" 
					                Width="7" 
					                Stretch="Fill" 
					                StrokeThickness="0" 
					                HorizontalAlignment="Left" 
					                VerticalAlignment="Bottom" RenderTransformOrigin="0,0.5" UseLayoutRounding="False" Margin="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=left}" >
                                    <Path.RenderTransform>
                                        <CompositeTransform ScaleX="-1"/>
                                    </Path.RenderTransform>

                                </Path>
                                <Path Visibility="Collapsed" Data="M40,0 L50,0 L50,10 L50,50 L10,50 L0,50 L1.07807,49.8028 L1.56503,49.7065 C17.9155,46.3054 39.5156,31.5547 40,10 L40,0.25 z" 
                                    Fill="{TemplateBinding Background}" 
                                    Height="8" 
                                    Width="8" 
                                    Stretch="Fill" 
                                    StrokeThickness="0" 
                                    HorizontalAlignment="Right" 
                                    VerticalAlignment="Bottom" >
                                    <Path.RenderTransform>
                                        <TransformGroup>
                                            <TranslateTransform X="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource projectThicknessConverter}, ConverterParameter=left}" />
                                            <TranslateTransform X="-6" />
                                            <TranslateTransform Y="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource projectThicknessConverter}, ConverterParameter=top}" />
                                        </TransformGroup>
                                    </Path.RenderTransform>
                                </Path>
                                <Path Visibility="Collapsed" Data="M40,0 L50,0 L50,10 C50,32.0915 32.0914,50 10,50 L0,50 C16.5,47.25 39.5,32.25 40,10 L40,0.25 z" 
                                    Fill="{TemplateBinding BorderBrush}" 
                                    Height="8" 
                                    Width="8" 
                                    Stretch="Fill" 
                                    StrokeThickness="{TemplateBinding BorderThickness}" 
                                    HorizontalAlignment="Right" 
                                    VerticalAlignment="Bottom" >
                                    <Path.RenderTransform>
                                        <TransformGroup>
                                            <TranslateTransform X="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource projectThicknessConverter}, ConverterParameter=left}" />
                                            <TranslateTransform X="-6" />
                                            <TranslateTransform Y="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource projectThicknessConverter}, ConverterParameter=top}" />
                                        </TransformGroup>
                                    </Path.RenderTransform>
                                </Path>
                            </Grid>
                            <Grid x:Name="rightRibbon" Grid.Column="2" Visibility="Collapsed" Width="8">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition Height="8" />
                                    </Grid.RowDefinitions>
                                    <Border Grid.RowSpan="2" Background="{TemplateBinding Background}"
                                        BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=top-right}"
                                        CornerRadius="0 4 0 0"/>
                                    <Border 
                                         BorderBrush="{TemplateBinding BorderBrush}" 
                                         BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=top-right}" 
                                         CornerRadius="0 4 0 0" />
                                </Grid>
                                <Border Grid.Row="2" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=right-left}" BorderBrush="{TemplateBinding BorderBrush}" HorizontalAlignment="Right" Height="8" Grid.RowSpan="2" Width="16" VerticalAlignment="Bottom" RenderTransformOrigin="1,0.5" Margin="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=right}" CornerRadius="0 0 8 0" >
                                    <Border.RenderTransform>
                                        <CompositeTransform ScaleX="-1"/>
                                    </Border.RenderTransform>
                                </Border>
                                <Path Data="M50,0 L50,50 L0,50 L-1.60044,49.8028 L-1.11353,47.3629 C39.8583,43.75 49.0713,11.7188 50,0 z" 
					                Fill="{TemplateBinding Background}" 
					                Height="8" 
					                Width="7" 
					                Stretch="Fill" 
					                StrokeThickness="0" 
					                HorizontalAlignment="Right" 
					                VerticalAlignment="Bottom" RenderTransformOrigin="1,0.5" UseLayoutRounding="False" Margin="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=right}" >
                                    <Path.RenderTransform>
                                        <CompositeTransform ScaleX="-1" TranslateX="-0.0019998550415039062"/>
                                    </Path.RenderTransform>
                                </Path>
                            </Grid>
                            <!-- Middle Element -->
                            <Border x:Name="MiddleElement" Grid.Column="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" 
                                    BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideThicknessConverter}, ConverterParameter=top}" UseLayoutRounding="True">
                                <!-- Content Presenter -->
                                <ContentPresenter Grid.Column="1" />
                            </Border>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1TabItemPresenter -->
    <Style 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>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <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>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="TabStripPlacementStates">
                                <VisualState x:Name="TopTabStripPlacement">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="BottomTabStripPlacement">
                                    <Storyboard>
                                        <PointAnimation Duration="0" To="0.5,0.5" Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)" Storyboard.TargetName="OuterTransformer"/>
                                        <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 BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ContentBorder" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 -1 1 -1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <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>
                                                    <TransformGroup>
                                                        <ScaleTransform ScaleX="-1" />
                                                        <RotateTransform Angle="-90" />
                                                    </TransformGroup>
                                                </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>Stretch</HorizontalAlignment>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Content" Storyboard.TargetProperty="HorizontalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <HorizontalAlignment>Left</HorizontalAlignment>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="RightTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ContentBorder" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 -1 1 -1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <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="InnerTransformer" Storyboard.TargetProperty="LayoutTransform">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <TransformGroup>
                                                        <!--<ScaleTransform ScaleX="-1" />-->
                                                        <RotateTransform Angle="-90" />
                                                    </TransformGroup>
                                                </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>Stretch</HorizontalAlignment>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Content" 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">
                            <c1:C1LayoutTransformer.RenderTransform>
                                <CompositeTransform/>
                            </c1:C1LayoutTransformer.RenderTransform>
                            <Grid Margin="0 0 0 1" x:Name="MiddleGrid">
                                <c1:C1TabItemBorder x:Name="BackgroundElement" Shape="{TemplateBinding TabShape}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
                                <c1:C1TabItemBorder x:Name="SelectedElement"  Shape="{TemplateBinding TabShape}" Background="{TemplateBinding SelectedBackground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Visibility="Collapsed" />
                                <c1:C1TabItemBorder x:Name="MouseOverElement" Shape="{TemplateBinding TabShape}" Background="{TemplateBinding MouseOverBrush}" BorderBrush="{TemplateBinding BorderBrush}"  BorderThickness="{TemplateBinding BorderThickness}" Visibility="Collapsed" />
                                <c1:C1TabItemBorder Shape="{TemplateBinding TabShape}">
                                    <c1:C1LayoutTransformer x:Name="InnerTransformer" Margin="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}}">
                                        <Border x:Name="ContentBorder">
                                            <c1:C1LayoutRounder x:Name="Content" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                                        </Border>
                                    </c1:C1LayoutTransformer>
                                </c1:C1TabItemBorder>
                            </Grid>
                        </c1:C1LayoutTransformer>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1TabItem -->
    <Style TargetType="c1:C1TabItem">
        <Setter Property="Padding" Value="8" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1:C1TabItem">
                    <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>
                            <VisualStateGroup x:Name="PinModeStates">
                                <VisualState x:Name="Pinned">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="UnpinButton" 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="UnpinButton" Storyboard.TargetProperty="IsEnabled">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="True">
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="PinButton" 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="PinButton" Storyboard.TargetProperty="IsEnabled">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="False">
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unpinned">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="PinButton" 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="PinButton" Storyboard.TargetProperty="IsEnabled">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="True">
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="UnpinButton" 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="UnpinButton" Storyboard.TargetProperty="IsEnabled">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="False">
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Selected" >
                                    <Storyboard>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unselected" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1TabItemPresenter x:Name="C1TabItemPresenter" IsSelected="{TemplateBinding IsSelected}" TabShape="{TemplateBinding TabShape}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" MouseOverBrush="{TemplateBinding MouseOverBrush}" SelectedBackground="{TemplateBinding SelectedBackground}" PressedBrush="{TemplateBinding PressedBrush}" Padding="{TemplateBinding Padding}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <ContentPresenter x:Name="HeaderPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                <StackPanel Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
                                    <StackPanel x:Name="StackPanelPinButtons" Margin="15 -10 -18 -10" Opacity="0.5" HorizontalAlignment="Right" Orientation="Horizontal">
                                        <Button x:Name="UnpinButton"  Margin="0" Padding="0" 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="0" VerticalAlignment="Center" HorizontalAlignment="Right" >
                                            <Grid Height="19" Width="16" Margin="9 7.5">
                                                <Path x:Name="UnPin" Data="M3,0 L4,0 L12,0 L13,0 L12.000004,3 L12,8.0629177 L12.099907,8.1189432 C13.876015,9.1610928 15.262439,10.859362 15.968626,12.905499 L16,12.999999 L9,12.999999 L9,19 L7,19 L7,12.999999 L0,12.999999 L0.031373978,12.905499 C0.73756123,10.859362 2.1239862,9.1610928 3.9000931,8.1189432 L4,8.0629177 L4,3 z" Fill="{TemplateBinding Foreground}" Stretch="Uniform"/>
                                            </Grid>
                                        </Button>
                                        <Button x:Name="PinButton" Margin="0" Padding="0" 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="0" VerticalAlignment="Center" HorizontalAlignment="Right" Visibility="Collapsed" IsEnabled="False" >
                                            <Grid Width="19" Height="16" Margin="7.5 9">
                                                <Path x:Name="Pin" Data="M6.0000014,0 L6.094502,0.031373978 C8.1406393,0.73756123 9.8389072,2.1239858 10.881058,3.9000931 L10.937083,4 L16.000002,4 L19.000002,3 L19.000002,4 L19.000002,12 L19.000002,13 L16.000002,12.000004 L10.937083,12 L10.881058,12.099907 C9.8389072,13.876015 8.1406393,15.262439 6.094502,15.968626 L6.0000014,16 L6.0000014,9 L0,9 L0,7 L6.0000014,7 z" Fill="{TemplateBinding Foreground}" Stretch="Uniform"/>
                                            </Grid>
                                        </Button>
                                    </StackPanel>
                                    <Button x:Name="CloseButton" Margin="15 -10 -18 -10" Opacity="0.5" 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="0" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="0">
                                        <TextBlock x:Name="Close" Height="30" Width="30" Margin="4 4 0 0" Text="&#xE10A;" Style="{StaticResource TextIconStyle}" VerticalAlignment="Top" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="Left" />
                                    </Button>
                                </StackPanel>
                            </Grid>
                        </c1:C1TabItemPresenter>
                        <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1TabControl -->
    <Style TargetType="c1:C1TabControl">
        <Setter Property="Foreground" Value="{ThemeResource TabControlForegroundThemeBrush}"/>
        <Setter Property="Background" Value="{ThemeResource TabControlBackgroundThemeBrush}"/>
        <Setter Property="BorderBrush" Value="{ThemeResource TabControlBorderThemeBrush}"/>
        <Setter Property="BorderThickness" Value="{ThemeResource TabControlBorderThemeThickness}"/>
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
        <Setter Property="MouseOverBrush" Value="{ThemeResource TabControlPointerOverBackgroundThemeBrush}" />
        <Setter Property="PressedBrush" Value="{ThemeResource TabControlSelectedBackgroundThemeBrush}" />
        <Setter Property="TabStripBackground" Value="{ThemeResource TabControlTabStripBackgroundThemeBrush}" />
        <Setter Property="TabStripForeground" Value="{ThemeResource TabControlTabStripForegroundThemeBrush}" />
        <Setter Property="SelectedBackground" Value="{ThemeResource TabControlSelectedBackgroundThemeBrush}"/>
        <Setter Property="Padding" Value="8,10"/>
        <Setter Property="TabStripOverlap" Value="0" />
        <Setter Property="TabStripPlacement" Value="Top" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1:C1TabControl">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="DisabledVisualElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="TabStripPlacementStates">
                                <VisualState x:Name="BottomTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TabPanelPresenter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 -1 0 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 0 -1 0</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" Value="False">
                                            </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>0 0 0 -1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LineOuter" Storyboard.TargetProperty="Reverse">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="False">
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="RightTabStripPlacement">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TabPanelPresenter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 -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: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}">
                                <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:C1LinePanel.LineDefinitions>
                                <Border x:Name="LeftFilling" Visibility="Collapsed" Width="8" Height="8" />
                                <!-- Previous -->
                                <RepeatButton x:Name="PreviousButton" Height="38" Width="38" 
                                              Content="&#xe09E;"
                                              Padding="0 -3 0 0"
                                              c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}"
                                              c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" 
                                              c1:ClearStyleExtensions.CornerRadius="0" 
                                              Background="{TemplateBinding TabStripBackground}" 
                                              Foreground="{TemplateBinding TabStripForeground}" 
                                              BorderThickness="{TemplateBinding BorderThickness}" 
                                              BorderBrush="{TemplateBinding BorderBrush}" 
                                              HorizontalContentAlignment="Center" 
                                              RenderTransformOrigin="0.5,0.5"
                                              Style="{StaticResource NavigationButtonStyle}"
                                              HorizontalAlignment="Center" >
                                    <RepeatButton.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform />
                                            <SkewTransform />
                                            <RotateTransform />
                                            <TranslateTransform />
                                        </TransformGroup>
                                    </RepeatButton.RenderTransform>
                                </RepeatButton>
                                <!-- TabPanel -->
                                <ContentPresenter x:Name="TabPanelPresenter" Grid.Column="1" Margin="0 -1 0 0" HorizontalAlignment="{TemplateBinding TabStripHorizontalAlignment}" VerticalAlignment="{TemplateBinding TabStripVerticalAlignment}">
                                    <ContentPresenter.Content>
                                        <c1:C1TabPanel x:Name="TabPanel" Orientation="Horizontal" HorizontalAlignment="{TemplateBinding TabStripHorizontalAlignment}" VerticalAlignment="{TemplateBinding TabStripVerticalAlignment}" />
                                    </ContentPresenter.Content>
                                </ContentPresenter>
                                <!-- Next -->
                                <RepeatButton x:Name="NextButton" Height="38" Width="38" 
                                              Content="&#xe09F;" 
                                              Padding="0 -3 0 0"
                                              c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" 
                                              c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" 
                                              c1:ClearStyleExtensions.CornerRadius="0" 
                                              Background="{TemplateBinding TabStripBackground}" 
                                              Foreground="{TemplateBinding TabStripForeground}" 
                                              BorderThickness="{TemplateBinding BorderThickness}" 
                                              BorderBrush="{TemplateBinding BorderBrush}" 
                                              HorizontalContentAlignment="Center"
                                              RenderTransformOrigin="0.5,0.5" 
                                              Style="{StaticResource NavigationButtonStyle}"
                                              HorizontalAlignment="Center" >
                                    <RepeatButton.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform />
                                            <SkewTransform />
                                            <RotateTransform />
                                            <TranslateTransform />
                                        </TransformGroup>
                                    </RepeatButton.RenderTransform>
                                </RepeatButton>
                                <!-- TabStripMenu -->
                                <c1:C1DropDownButton x:Name="TabStripDropDown" HeaderPadding="3 -2 2 4" HeaderFontSize="16" HeaderFontFamily="Segoe UI Symbol" Header="&#xE019;" Height="38" Width="38" AutoClose="True" Margin="0" MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.CornerRadius="0" Background="{TemplateBinding TabStripBackground}" Foreground="{TemplateBinding TabStripForeground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Visibility="{TemplateBinding TabStripMenuVisibility}"  Style="{StaticResource TabStripDropDown}">
                                    <c1:C1MenuList x:Name="Menu" Padding="0" 
                                                   BorderBrush="{TemplateBinding BorderBrush}" 
                                                   BorderThickness="{TemplateBinding BorderThickness}" 
                                                   Background="{TemplateBinding Background}" 
                                                   HighlightedBackground="{TemplateBinding MouseOverBrush}" 
                                                   OpenedBackground="{TemplateBinding PressedBrush}" 
                                                   Foreground="{TemplateBinding Foreground}" />
                                </c1:C1DropDownButton>
                                <!-- Close -->
                                <Button x:Name="CloseButton" Height="38" Width="38" 
                                              Content="&#xE10A;" 
                                              Padding="0"
                                              Background="{TemplateBinding TabStripBackground}" 
                                              Foreground="{TemplateBinding TabStripForeground}" 
                                              BorderThickness="{TemplateBinding BorderThickness}" 
                                              BorderBrush="{TemplateBinding BorderBrush}" 
                                              HorizontalContentAlignment="Center"
                                              Style="{StaticResource NavigationButtonCloseStyle}"
                                              HorizontalAlignment="Center">
                                </Button>
                                <Border x:Name="RightFilling" Visibility="Collapsed" Width="8" Height="8" />
                            </c1:C1LinePanel>
                            <Grid>
                                <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                                    <ContentPresenter x:Name="SelectedItemContent" ContentTemplate="{x:Null}" />
                                </Border>
                                <Rectangle x:Name="DisabledVisualElement" Fill="{StaticResource DisabledBrush}" Visibility="Collapsed" />
                            </Grid>
                        </c1:C1LinePanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>