<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:av="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals"
    xmlns:controls="using:Microsoft.UI.Xaml.Controls"
    xmlns:core="using:CharacterMap.Core"
    xmlns:h="using:CharacterMap.Helpers"
    xmlns:primitives="using:Microsoft.UI.Xaml.Controls.Primitives">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Styles/Brushes.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary x:Key="Light">
            <StaticResource x:Key="TabViewBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderBackground" ResourceKey="LayerOnMicaBaseAltFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderBackgroundSelected" ResourceKey="LayerOnMicaBaseAltFillColorDefaultBrush" />
            <StaticResource x:Key="TabViewItemHeaderBackgroundPointerOver" ResourceKey="LayerOnMicaBaseAltFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderBackgroundPressed" ResourceKey="LayerOnMicaBaseAltFillColorDefaultBrush" />
            <StaticResource x:Key="TabViewItemHeaderBackgroundDisabled" ResourceKey="LayerOnMicaBaseAltFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderForeground" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderForegroundSelected" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
            <StaticResource x:Key="TabViewItemIconForeground" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemIconForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" />
            <StaticResource x:Key="TabViewItemIconForegroundSelected" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemIconForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemIconForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
            <StaticResource x:Key="TabViewButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" />
            <StaticResource x:Key="TabViewButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewButtonBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewButtonForeground" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewButtonForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewButtonForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewButtonForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
            <StaticResource x:Key="TabViewButtonBorderBrush" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewButtonBorderBrushPressed" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewButtonBorderBrushPointerOver" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewButtonBorderBrushDisabled" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewScrollButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewScrollButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" />
            <StaticResource x:Key="TabViewScrollButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewScrollButtonBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewScrollButtonForeground" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewScrollButtonForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewScrollButtonForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewScrollButtonForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
            <StaticResource x:Key="TabViewScrollButtonBorderBrush" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewScrollButtonBorderBrushPressed" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewScrollButtonBorderBrushPointerOver" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewScrollButtonBorderBrushDisabled" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemSeparator" ResourceKey="DividerStrokeColorDefaultBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderPressedCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderPointerOverCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderSelectedCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderDisabledCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonForeground" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderPressedCloseButtonForeground" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderPointerOverCloseButtonForeground" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderSelectedCloseButtonForeground" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderDisabledCloseButtonForeground" ResourceKey="TextFillColorDisabledBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBorderBrush" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBorderBrushPointerOver" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBorderBrushPressed" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBorderBrushSelected" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBorderBrushDisabled" ResourceKey="SubtleFillColorTransparentBrush" />

            <!--  Note: These theme resources below are no longer used and might be removed in a future WinUI update.  -->
            <StaticResource x:Key="TabViewButtonBackgroundActiveTab" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewButtonForegroundActiveTab" ResourceKey="ControlStrongFillColorDefaultBrush" />

            <StaticResource x:Key="TabViewBorderBrush" ResourceKey="CardStrokeColorDefault" />
            <StaticResource x:Key="TabViewItemBorderBrush" ResourceKey="SubtleFillColorTransparentBrush" />
            <Thickness x:Key="TabViewButtonBorderThickness">0</Thickness>
            <Thickness x:Key="TabViewItemHeaderCloseButtonBorderThickness">0</Thickness>
            <LinearGradientBrush x:Key="TabViewSelectedItemBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,4">
                <LinearGradientBrush.RelativeTransform>
                    <ScaleTransform CenterY="0.5" ScaleY="-1" />
                </LinearGradientBrush.RelativeTransform>
                <LinearGradientBrush.GradientStops>
                    <GradientStop Offset="1.0" Color="Transparent" />
                    <GradientStop Offset="1.0" Color="{ThemeResource CardStrokeColorDefault}" />
                </LinearGradientBrush.GradientStops>
            </LinearGradientBrush>
        </ResourceDictionary>
        <ResourceDictionary x:Key="Dark">
            <StaticResource x:Key="TabViewBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderBackground" ResourceKey="LayerOnMicaBaseAltFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderBackgroundSelected" ResourceKey="LayerOnMicaBaseAltFillColorDefaultBrush" />
            <StaticResource x:Key="TabViewItemHeaderBackgroundPointerOver" ResourceKey="LayerOnMicaBaseAltFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderBackgroundPressed" ResourceKey="LayerOnMicaBaseAltFillColorDefaultBrush" />
            <StaticResource x:Key="TabViewItemHeaderBackgroundDisabled" ResourceKey="LayerOnMicaBaseAltFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderForeground" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderForegroundSelected" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
            <StaticResource x:Key="TabViewItemIconForeground" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemIconForegroundPressed" ResourceKey="TextFillColorTertiaryBrush" />
            <StaticResource x:Key="TabViewItemIconForegroundSelected" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemIconForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemIconForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
            <StaticResource x:Key="TabViewButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" />
            <StaticResource x:Key="TabViewButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewButtonBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewButtonForeground" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewButtonForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewButtonForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewButtonForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
            <StaticResource x:Key="TabViewButtonBorderBrush" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewButtonBorderBrushPressed" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewButtonBorderBrushPointerOver" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewButtonBorderBrushDisabled" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewScrollButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewScrollButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" />
            <StaticResource x:Key="TabViewScrollButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewScrollButtonBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewScrollButtonForeground" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewScrollButtonForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewScrollButtonForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewScrollButtonForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
            <StaticResource x:Key="TabViewScrollButtonBorderBrush" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewScrollButtonBorderBrushPressed" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewScrollButtonBorderBrushPointerOver" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewScrollButtonBorderBrushDisabled" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemSeparator" ResourceKey="DividerStrokeColorDefaultBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBackgroundPressed" ResourceKey="SubtleFillColorTertiaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBackgroundPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderPressedCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderPointerOverCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderSelectedCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderDisabledCloseButtonBackground" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonForeground" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonForegroundPointerOver" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderPressedCloseButtonForeground" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderPointerOverCloseButtonForeground" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderSelectedCloseButtonForeground" ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="TabViewItemHeaderDisabledCloseButtonForeground" ResourceKey="TextFillColorDisabledBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBorderBrush" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBorderBrushPointerOver" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBorderBrushPressed" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBorderBrushSelected" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewItemHeaderCloseButtonBorderBrushDisabled" ResourceKey="SubtleFillColorTransparentBrush" />

            <!--  Note: These theme resources below are no longer used and might be removed in a future WinUI update.  -->
            <StaticResource x:Key="TabViewButtonBackgroundActiveTab" ResourceKey="SubtleFillColorTransparentBrush" />
            <StaticResource x:Key="TabViewButtonForegroundActiveTab" ResourceKey="ControlStrongFillColorDefaultBrush" />

            <StaticResource x:Key="TabViewBorderBrush" ResourceKey="CardStrokeColorDefault" />
            <StaticResource x:Key="TabViewItemBorderBrush" ResourceKey="SubtleFillColorTransparentBrush" />
            <Thickness x:Key="TabViewButtonBorderThickness">0</Thickness>
            <Thickness x:Key="TabViewItemHeaderCloseButtonBorderThickness">0</Thickness>
            <LinearGradientBrush x:Key="TabViewSelectedItemBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,4">
                <LinearGradientBrush.RelativeTransform>
                    <ScaleTransform CenterY="0.5" ScaleY="-1" />
                </LinearGradientBrush.RelativeTransform>
                <LinearGradientBrush.GradientStops>
                    <GradientStop Offset="1.0" Color="Transparent" />
                    <GradientStop Offset="1.0" Color="{ThemeResource CardStrokeColorDefault}" />
                </LinearGradientBrush.GradientStops>
            </LinearGradientBrush>
        </ResourceDictionary>
    </ResourceDictionary.ThemeDictionaries>

    <primitives:CornerRadiusFilterConverter x:Key="TopCornerRadiusFilterConverter" Filter="Top" />

    <Thickness x:Key="TabViewHeaderPadding">0,8,0,0</Thickness>
    <Thickness x:Key="TabViewItemHeaderPadding">8,15,4,3</Thickness>
    <Thickness x:Key="TabViewSelectedItemHeaderPadding">9,3,5,4</Thickness>

    <x:Double x:Key="TabViewItemMinHeight">32</x:Double>
    <x:Double x:Key="TabViewItemMaxWidth">240</x:Double>
    <x:Double x:Key="TabViewItemMinWidth">100</x:Double>

    <x:Double x:Key="TabViewItemHeaderFontSize">12</x:Double>
    <x:Double x:Key="TabViewItemHeaderIconSize">16</x:Double>
    <Thickness x:Key="TabViewItemHeaderIconMargin">0,0,10,0</Thickness>


    <x:Double x:Key="TabViewItemHeaderCloseButtonHeight">24</x:Double>
    <x:Double x:Key="TabViewItemHeaderCloseButtonWidth">32</x:Double>

    <x:Double x:Key="TabViewItemHeaderCloseButtonSize">16</x:Double>
    <x:Double x:Key="TabViewItemHeaderCloseFontSize">12</x:Double>
    <Thickness x:Key="TabViewItemHeaderCloseMargin">4,0,0,0</Thickness>

    <x:Double x:Key="TabViewItemScrollButtonWidth">32</x:Double>
    <x:Double x:Key="TabViewItemScrollButtonHeight">24</x:Double>
    <x:Double x:Key="TabViewItemScrollButonFontSize">8</x:Double>
    <Thickness x:Key="TabViewItemScrollButtonPadding">7,3,7,3</Thickness>
    <Thickness x:Key="TabViewItemLeftScrollButtonContainerPadding">8,0,3,3</Thickness>
    <Thickness x:Key="TabViewItemRightScrollButtonContainerPadding">3,0,8,3</Thickness>

    <x:Double x:Key="TabViewItemAddButtonWidth">32</x:Double>
    <x:Double x:Key="TabViewItemAddButtonHeight">24</x:Double>
    <x:Double x:Key="TabViewItemAddButtonFontSize">12</x:Double>
    <Thickness x:Key="TabViewItemAddButtonContainerPadding">3,0,0,3</Thickness>

    <x:Double x:Key="TabViewShadowDepth">16</x:Double>

    <Thickness x:Key="TabViewItemSeparatorMargin">0,8,0,8</Thickness>

    <Thickness x:Key="TabViewItemBorderThickness">1</Thickness>

    <Thickness x:Key="TabViewSelectedItemBorderThickness">1,1,1,0</Thickness>

    <Thickness x:Key="TabViewSelectedItemHeaderMargin">-1,0,-1,0</Thickness>

    <Style x:Name="TabViewButtonStyle" TargetType="Button">
        <Setter Property="Background" Value="{ThemeResource TabViewButtonBackground}" />
        <Setter Property="Foreground" Value="{ThemeResource TabViewButtonForeground}" />
        <Setter Property="FontSize" Value="{ThemeResource TabViewItemAddButtonFontSize}" />
        <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
        <Setter Property="Width" Value="{ThemeResource TabViewItemAddButtonWidth}" />
        <Setter Property="Height" Value="{ThemeResource TabViewItemAddButtonHeight}" />
        <Setter Property="core:Properties.ToolTipStyleKey" Value="DefaultThemeToolTipStyle" />
        <Setter Property="FocusVisualMargin" Value="-3" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border
                        x:Name="BorderRoot"
                        Background="{TemplateBinding Background}"
                        CornerRadius="{ThemeResource ControlCornerRadius}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup
                                x:Name="CommonStates"
                                h:FluentAnimation.PointerDownScale="0.85"
                                h:FluentAnimation.PointerOver="{Binding ElementName=ContentPresenter}"
                                h:FluentAnimation.Pressed="{Binding ElementName=ContentPresenter}">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderRoot" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewButtonBackgroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewButtonForegroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderRoot" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewButtonBackgroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewButtonForegroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderRoot" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewButtonBackgroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewButtonForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <ContentPresenter
                            x:Name="ContentPresenter"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                            AutomationProperties.AccessibilityView="Raw"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            ContentTransitions="{TemplateBinding ContentTransitions}"
                            FontFamily="{TemplateBinding FontFamily}"
                            FontSize="{TemplateBinding FontSize}"
                            FontWeight="{TemplateBinding FontWeight}" />
                    </Border>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="TabViewStyle" TargetType="controls:TabView">
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="Padding" Value="{ThemeResource TabViewHeaderPadding}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Background" Value="{ThemeResource TabViewBackground}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:TabView">
                    <Grid Margin="{TemplateBinding Padding}">
                        <Grid
                            x:Name="TabContainerGrid"
                            ChildrenTransitions="{Binding Path=(core:Properties.ChildrenTransitions), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                            XYFocusKeyboardNavigation="Enabled">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Name="LeftContentColumn" Width="Auto" />
                                <ColumnDefinition x:Name="TabColumn" Width="Auto" />
                                <ColumnDefinition x:Name="AddButtonColumn" Width="Auto" />
                                <ColumnDefinition x:Name="RightContentColumn" Width="*" />
                            </Grid.ColumnDefinitions>
                            <ContentPresenter
                                x:Name="LeftContentPresenter"
                                Grid.Column="0"
                                Content="{TemplateBinding TabStripHeader}"
                                ContentTemplate="{TemplateBinding TabStripHeaderTemplate}" />
                            <!--core:Properties.ToolTipTemplate="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(core:Properties.ToolTipTemplate)}"-->
                            <primitives:TabViewListView
                                x:Name="TabListView"
                                Grid.Column="1"
                                MaxWidth="{Binding ElementName=TabColumn, Path=MaxWidth}"
                                AllowDrop="{TemplateBinding AllowDropTabs}"
                                Background="{x:Null}"
                                CanDragItems="{TemplateBinding CanDragTabs}"
                                CanReorderItems="{TemplateBinding CanReorderTabs}"
                                ItemTemplate="{TemplateBinding TabItemTemplate}"
                                ItemTemplateSelector="{TemplateBinding TabItemTemplateSelector}"
                                ItemsSource="{TemplateBinding TabItemsSource}" />
                            <StackPanel
                                Grid.Column="2"
                                Padding="{ThemeResource TabViewItemAddButtonContainerPadding}"
                                VerticalAlignment="Bottom"
                                Canvas.ZIndex="-1"
                                Orientation="Horizontal"
                                Visibility="{Binding IsAddTabButtonVisible, RelativeSource={RelativeSource Mode=TemplatedParent}}">
                                <Button
                                    x:Name="AddButton"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Command="{TemplateBinding AddTabButtonCommand}"
                                    CommandParameter="{TemplateBinding AddTabButtonCommandParameter}"
                                    Content="&#xE710;"
                                    HighContrastAdjustment="None"
                                    IsTextScaleFactorEnabled="False"
                                    Style="{ThemeResource TabViewButtonStyle}" />
                                <Button
                                    x:Name="CollectionButton"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    core:Properties.SupportAnimatedIcon="True"
                                    HighContrastAdjustment="None"
                                    IsTextScaleFactorEnabled="False"
                                    Style="{ThemeResource TabViewButtonStyle}">
                                    <Button.Content>
                                        <controls:AnimatedIcon Height="14" IsHitTestVisible="False">
                                            <av:AnimatedChevronDownSmallVisualSource />
                                            <controls:AnimatedIcon.FallbackIconSource>
                                                <controls:FontIconSource
                                                    FontFamily="{StaticResource SymbolThemeFontFamily}"
                                                    FontSize="{Binding ElementName=CollectionButton, Path=FontSize}"
                                                    Glyph="&#xE70D;" />
                                            </controls:AnimatedIcon.FallbackIconSource>
                                        </controls:AnimatedIcon>
                                    </Button.Content>
                                    <Button.Flyout>
                                        <MenuFlyout Placement="Bottom">
                                            <MenuFlyoutItem x:Uid="CompareActiveItem" Style="{StaticResource ThemeMenuFlyoutItemStyle}">
                                                <MenuFlyoutItem.Icon>
                                                    <FontIcon Glyph="&#xE8F1;" />
                                                </MenuFlyoutItem.Icon>
                                            </MenuFlyoutItem>
                                            <MenuFlyoutSubItem x:Uid="AddActiveToCollectionItem" Style="{StaticResource ThemeMenuFlyoutSubItemStyle}">
                                                <MenuFlyoutSubItem.Icon>
                                                    <FontIcon Glyph="&#xE8F4;" />
                                                </MenuFlyoutSubItem.Icon>
                                            </MenuFlyoutSubItem>
                                        </MenuFlyout>
                                    </Button.Flyout>
                                </Button>

                                <!--  This is needed to stop cropping of the add button  -->
                                <Border Width="16" />
                            </StackPanel>
                            <ContentPresenter
                                x:Name="RightContentPresenter"
                                Grid.Column="3"
                                HorizontalAlignment="Stretch"
                                Content="{TemplateBinding TabStripFooter}"
                                ContentTemplate="{TemplateBinding TabStripFooterTemplate}"
                                IsHitTestVisible="False" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="primitives:TabViewListView">
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="TabNavigation" Value="Once" />
        <Setter Property="IsSwipeEnabled" Value="False" />
        <Setter Property="SingleSelectionFollowsFocus" Value="False" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" />
        <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled" />
        <Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="False" />
        <Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled" />
        <Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="False" />
        <Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
        <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
        <Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True" />
        <Setter Property="ItemContainerTransitions">
            <Setter.Value>
                <TransitionCollection />
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <ItemsStackPanel CacheLength="0" Orientation="Horizontal" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:TabViewListView">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        CornerRadius="{TemplateBinding CornerRadius}">

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup>
                                <VisualState x:Name="LeftBottomBorderLineNormal" />
                                <VisualState x:Name="LeftBottomBorderLineShort">
                                    <VisualState.Setters>
                                        <Setter Target="LeftBottomBorderLine.Width" Value="2" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup>
                                <VisualState x:Name="RightBottomBorderLineNormal" />
                                <VisualState x:Name="RightBottomBorderLineShort">
                                    <VisualState.Setters>
                                        <Setter Target="RightBottomBorderLine.Width" Value="2" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup>
                                <VisualState x:Name="NormalBottomBorderLine" />
                                <VisualState x:Name="NoBottomBorderLine">
                                    <VisualState.Setters>
                                        <Setter Target="LeftBottomBorderLine.Visibility" Value="Collapsed" />
                                        <Setter Target="RightBottomBorderLine.Visibility" Value="Collapsed" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <ScrollViewer
                            x:Name="ScrollViewer"
                            Grid.Column="1"
                            AutomationProperties.AccessibilityView="Raw"
                            BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}"
                            HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                            HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
                            IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
                            IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
                            IsHorizontalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsHorizontalScrollChainingEnabled}"
                            IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
                            IsVerticalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsVerticalScrollChainingEnabled}"
                            Style="{StaticResource TabScrollViewerStyle}"
                            TabNavigation="{TemplateBinding TabNavigation}"
                            VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
                            VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
                            ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}">

                            <ItemsPresenter x:Name="TabsItemsPresenter" Padding="{TemplateBinding Padding}">
                                <ItemsPresenter.Header>
                                    <Grid Width="4">
                                        <Border
                                            x:Name="LeftBottomBorderLine"
                                            Width="4"
                                            Height="1"
                                            HorizontalAlignment="Left"
                                            VerticalAlignment="Bottom"
                                            BorderBrush="{ThemeResource TabViewBorderBrush}"
                                            BorderThickness="1" />
                                    </Grid>
                                </ItemsPresenter.Header>
                                <ItemsPresenter.Footer>
                                    <Grid Width="4">
                                        <Border
                                            x:Name="RightBottomBorderLine"
                                            Width="4"
                                            Height="1"
                                            HorizontalAlignment="Right"
                                            VerticalAlignment="Bottom"
                                            BorderBrush="{ThemeResource TabViewBorderBrush}"
                                            BorderThickness="1" />
                                    </Grid>
                                </ItemsPresenter.Footer>
                            </ItemsPresenter>

                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Name="TabScrollViewerStyle" TargetType="ScrollViewer">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollViewer">
                    <Border
                        x:Name="Root"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup>
                                <VisualState x:Name="NormalBottomBorderLine" />
                                <VisualState x:Name="NoBottomBorderLine">
                                    <VisualState.Setters>
                                        <Setter Target="LeftBottomBorderLine.Visibility" Value="Collapsed" />
                                        <Setter Target="RightBottomBorderLine.Visibility" Value="Collapsed" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" MinWidth="2" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>

                            <Border
                                x:Name="LeftBottomBorderLine"
                                Height="1"
                                VerticalAlignment="Bottom"
                                BorderBrush="{ThemeResource TabViewBorderBrush}"
                                BorderThickness="1" />

                            <Border
                                x:Name="RightBottomBorderLine"
                                Grid.Column="2"
                                Height="1"
                                VerticalAlignment="Bottom"
                                BorderBrush="{ThemeResource TabViewBorderBrush}"
                                BorderThickness="1" />

                            <Border
                                x:Name="ScrollDecreaseButtonContainer"
                                Padding="{ThemeResource TabViewItemLeftScrollButtonContainerPadding}"
                                VerticalAlignment="Bottom"
                                Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}">
                                <RepeatButton
                                    x:Name="ScrollDecreaseButton"
                                    AutomationProperties.AccessibilityView="Raw"
                                    Content="&#xEDD9;"
                                    Delay="50"
                                    HighContrastAdjustment="None"
                                    Interval="100"
                                    IsTabStop="False"
                                    Style="{ThemeResource TabViewScrollButtonStyle}" />
                            </Border>

                            <ScrollContentPresenter
                                x:Name="ScrollContentPresenter"
                                Grid.Column="1"
                                Padding="1,0,0,0"
                                TabFocusNavigation="Once" />

                            <Border
                                x:Name="ScrollIncreaseButtonContainer"
                                Grid.Column="2"
                                Padding="{ThemeResource TabViewItemRightScrollButtonContainerPadding}"
                                VerticalAlignment="Bottom"
                                Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}">
                                <RepeatButton
                                    x:Name="ScrollIncreaseButton"
                                    AutomationProperties.AccessibilityView="Raw"
                                    Content="&#xEDDA;"
                                    Delay="50"
                                    HighContrastAdjustment="None"
                                    Interval="100"
                                    IsTabStop="False"
                                    Style="{ThemeResource TabViewScrollButtonStyle}" />
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="TabViewCloseButtonStyle" TargetType="Button">
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
        <Setter Property="FontSize" Value="{ThemeResource TabViewItemHeaderCloseFontSize}" />
        <Setter Property="CornerRadius" Value="4" />
        <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
        <Setter Property="Width" Value="{ThemeResource TabViewItemHeaderCloseButtonWidth}" />
        <Setter Property="Height" Value="{ThemeResource TabViewItemHeaderCloseButtonHeight}" />
        <Setter Property="Background" Value="{ThemeResource TabViewItemHeaderCloseButtonBackground}" />
        <Setter Property="Foreground" Value="{ThemeResource TabViewItemHeaderCloseButtonForeground}" />
        <Setter Property="BorderBrush" Value="{ThemeResource TabViewItemHeaderCloseButtonBorderBrush}" />
        <Setter Property="BorderThickness" Value="{ThemeResource TabViewItemHeaderCloseButtonBorderThickness}" />
        <Setter Property="FocusVisualMargin" Value="-3" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border
                        x:Name="BorderRoot"
                        Background="{TemplateBinding Background}"
                        BackgroundSizing="{TemplateBinding BackgroundSizing}"
                        BackgroundTransition="{StaticResource QuickBackgroundTransition}"
                        CornerRadius="{TemplateBinding CornerRadius}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup
                                x:Name="CommonStates"
                                h:FluentAnimation.PointerDownScale="0.85"
                                h:FluentAnimation.Pressed="{Binding ElementName=ContentPresenter}">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderRoot" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewItemHeaderCloseButtonBackgroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewItemHeaderCloseButtonForegroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderRoot" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewItemHeaderCloseButtonBorderBrushPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderRoot" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewItemHeaderCloseButtonBackgroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewItemHeaderCloseButtonForegroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderRoot" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewItemHeaderCloseButtonBorderBrushPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter
                            x:Name="ContentPresenter"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                            AutomationProperties.AccessibilityView="Raw"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            ContentTransitions="{TemplateBinding ContentTransitions}" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Name="TabViewScrollButtonStyle" TargetType="RepeatButton">
        <Setter Property="Background" Value="{ThemeResource TabViewScrollButtonBackground}" />
        <Setter Property="Foreground" Value="{ThemeResource TabViewScrollButtonForeground}" />
        <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
        <Setter Property="FontSize" Value="{ThemeResource TabViewItemScrollButonFontSize}" />
        <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
        <Setter Property="Width" Value="{ThemeResource TabViewItemScrollButtonWidth}" />
        <Setter Property="Height" Value="{ThemeResource TabViewItemScrollButtonHeight}" />
        <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
        <Setter Property="BorderThickness" Value="{ThemeResource TabViewButtonBorderThickness}" />
        <Setter Property="BorderBrush" Value="{ThemeResource TabViewScrollButtonBorderBrush}" />
        <Setter Property="FocusVisualMargin" Value="-3" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RepeatButton">
                    <ContentPresenter
                        x:Name="ContentPresenter"
                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                        AutomationProperties.AccessibilityView="Raw"
                        Background="{TemplateBinding Background}"
                        BackgroundSizing="{TemplateBinding BackgroundSizing}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        ContentTransitions="{TemplateBinding ContentTransitions}"
                        CornerRadius="{TemplateBinding CornerRadius}"
                        FontFamily="{TemplateBinding FontFamily}"
                        FontSize="{TemplateBinding FontSize}"
                        FontWeight="{TemplateBinding FontWeight}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />

                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonBackgroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonForegroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonBorderBrushPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonBackgroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonForegroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonBorderBrushPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonBackgroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TabViewScrollButtonBorderBrushDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </ContentPresenter>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:TabViewItem">
        <Setter Property="Background" Value="{ThemeResource TabViewItemHeaderBackground}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
        <Setter Property="MinHeight" Value="32" />
        <Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="Tag">
            <Setter.Value>
                <x:Boolean>True</x:Boolean>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:TabViewItem">
                    <Grid
                        x:Name="LayoutRoot"
                        Padding="{TemplateBinding Padding}"
                        Background="Transparent"
                        BackgroundTransition="{StaticResource RootBackgroundTransition}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition x:Name="LeftColumn" Width="0" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition x:Name="RightColumn" Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <Grid.RenderTransform>
                            <ScaleTransform x:Name="LayoutRootScale" />
                        </Grid.RenderTransform>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates" h:FluentAnimation.Pressed="{Binding ElementName=ContentPresenter}">

                                <VisualState x:Name="Normal">
                                    <VisualState.Setters>
                                        <Setter Target="TabBackground.(h:CompositionProperty.Translation)" Value="0 40" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="PointerOver">
                                    <VisualState.Setters>
                                        <Setter Target="TabBackground.(h:CompositionProperty.Translation)" Value="0 0" />
                                        <Setter Target="TabBackground.Background" Value="{ThemeResource TabViewItemHeaderBackgroundPointerOver}" />
                                        <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TabViewItemHeaderForegroundPointerOver}" />
                                        <Setter Target="CloseButton.Background" Value="{ThemeResource TabViewItemHeaderPointerOverCloseButtonBackground}" />
                                        <Setter Target="CloseButton.Foreground" Value="{ThemeResource TabViewItemHeaderPointerOverCloseButtonForeground}" />
                                        <Setter Target="TabSeparator.Opacity" Value="0" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="Pressed">
                                    <VisualState.Setters>
                                        <Setter Target="TabBackground.(h:CompositionProperty.Translation)" Value="0 0" />
                                        <Setter Target="TabBackground.Background" Value="{ThemeResource TabViewItemHeaderBackgroundPointerOver}" />
                                        <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TabViewItemHeaderForegroundPressed}" />
                                        <Setter Target="CloseButton.Background" Value="{ThemeResource TabViewItemHeaderPressedCloseButtonBackground}" />
                                        <Setter Target="CloseButton.Foreground" Value="{ThemeResource TabViewItemHeaderPressedCloseButtonForeground}" />
                                        <Setter Target="TabSeparator.Opacity" Value="0" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="Selected">
                                    <VisualState.Setters>
                                        <Setter Target="TabBackground.(h:CompositionProperty.Translation)" Value="0 0" />
                                        <Setter Target="RightRadiusRenderArc.Visibility" Value="Visible" />
                                        <Setter Target="RightRadiusRenderTriangle.Visibility" Value="Visible" />
                                        <Setter Target="RightRadiusRenderTriangle.Fill" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" />
                                        <Setter Target="LeftRadiusRenderArc.Visibility" Value="Visible" />
                                        <Setter Target="LeftRadiusRenderTriangle.Visibility" Value="Visible" />
                                        <Setter Target="LeftRadiusRenderTriangle.Fill" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" />
                                        <Setter Target="SelectedBorder.Visibility" Value="Visible" />
                                        <Setter Target="TabBackground.Background" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" />
                                        <Setter Target="TabContainer.BorderThickness" Value="0" />
                                        <Setter Target="TabContainer.Padding" Value="{ThemeResource TabViewSelectedItemHeaderPadding}" />
                                        <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TabViewItemHeaderForegroundSelected}" />
                                        <Setter Target="CloseButton.Background" Value="{ThemeResource TabViewItemHeaderSelectedCloseButtonBackground}" />
                                        <Setter Target="CloseButton.Foreground" Value="{ThemeResource TabViewItemHeaderSelectedCloseButtonForeground}" />
                                        <Setter Target="LayoutRoot.Background" Value="Transparent" />
                                        <Setter Target="ContentPresenter.FontWeight" Value="SemiBold" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="PointerOverSelected">
                                    <VisualState.Setters>
                                        <Setter Target="TabBackground.(h:CompositionProperty.Translation)" Value="0 0" />
                                        <Setter Target="RightRadiusRenderArc.Visibility" Value="Visible" />
                                        <Setter Target="RightRadiusRenderTriangle.Visibility" Value="Visible" />
                                        <Setter Target="RightRadiusRenderTriangle.Fill" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" />
                                        <Setter Target="LeftRadiusRenderArc.Visibility" Value="Visible" />
                                        <Setter Target="LeftRadiusRenderTriangle.Visibility" Value="Visible" />
                                        <Setter Target="LeftRadiusRenderTriangle.Fill" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" />
                                        <Setter Target="SelectedBorder.Visibility" Value="Visible" />
                                        <Setter Target="TabBackground.Background" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" />
                                        <Setter Target="TabContainer.Padding" Value="{ThemeResource TabViewSelectedItemHeaderPadding}" />
                                        <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TabViewItemHeaderForegroundSelected}" />
                                        <Setter Target="CloseButton.Background" Value="{ThemeResource TabViewItemHeaderSelectedCloseButtonBackground}" />
                                        <Setter Target="CloseButton.Foreground" Value="{ThemeResource TabViewItemHeaderSelectedCloseButtonForeground}" />
                                        <Setter Target="LayoutRoot.Background" Value="Transparent" />
                                        <Setter Target="ContentPresenter.FontWeight" Value="SemiBold" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="PressedSelected">
                                    <VisualState.Setters>
                                        <Setter Target="TabBackground.(h:CompositionProperty.Translation)" Value="0 0" />
                                        <Setter Target="RightRadiusRenderArc.Visibility" Value="Visible" />
                                        <Setter Target="RightRadiusRenderTriangle.Visibility" Value="Visible" />
                                        <Setter Target="RightRadiusRenderTriangle.Fill" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" />
                                        <Setter Target="LeftRadiusRenderArc.Visibility" Value="Visible" />
                                        <Setter Target="LeftRadiusRenderTriangle.Visibility" Value="Visible" />
                                        <Setter Target="LeftRadiusRenderTriangle.Fill" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" />
                                        <Setter Target="SelectedBorder.Visibility" Value="Visible" />
                                        <Setter Target="TabBackground.Background" Value="{ThemeResource TabViewItemHeaderBackgroundSelected}" />
                                        <Setter Target="TabContainer.Padding" Value="{ThemeResource TabViewSelectedItemHeaderPadding}" />
                                        <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TabViewItemHeaderForegroundPressed}" />
                                        <Setter Target="CloseButton.Background" Value="{ThemeResource TabViewItemHeaderSelectedCloseButtonBackground}" />
                                        <Setter Target="CloseButton.Foreground" Value="{ThemeResource TabViewItemHeaderSelectedCloseButtonForeground}" />
                                        <Setter Target="LayoutRoot.Background" Value="Transparent" />
                                        <Setter Target="ContentPresenter.FontWeight" Value="SemiBold" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="DisabledStates">
                                <VisualState x:Name="Enabled" />
                                <VisualState x:Name="Disabled">
                                    <VisualState.Setters>
                                        <Setter Target="TabBackground.Background" Value="{ThemeResource TabViewItemHeaderBackgroundDisabled}" />
                                        <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TabViewItemHeaderForegroundDisabled}" />
                                        <Setter Target="CloseButton.Background" Value="{ThemeResource TabViewItemHeaderDisabledCloseButtonBackground}" />
                                        <Setter Target="CloseButton.Foreground" Value="{ThemeResource TabViewItemHeaderDisabledCloseButtonForeground}" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="ReorderHintStates">
                                <VisualState x:Name="NoReorderHint" />

                                <VisualState x:Name="BottomReorderHint">
                                    <Storyboard>
                                        <DragOverThemeAnimation
                                            Direction="Bottom"
                                            ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}"
                                            TargetName="LayoutRoot" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="TopReorderHint">
                                    <Storyboard>
                                        <DragOverThemeAnimation
                                            Direction="Top"
                                            ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}"
                                            TargetName="LayoutRoot" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="RightReorderHint">
                                    <Storyboard>
                                        <DragOverThemeAnimation
                                            Direction="Right"
                                            ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}"
                                            TargetName="LayoutRoot" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="LeftReorderHint">
                                    <Storyboard>
                                        <DragOverThemeAnimation
                                            Direction="Left"
                                            ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}"
                                            TargetName="LayoutRoot" />
                                    </Storyboard>
                                </VisualState>

                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.2" To="NoReorderHint" />
                                </VisualStateGroup.Transitions>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="DragStates">
                                <VisualState x:Name="NotDragging" />

                                <VisualState x:Name="Dragging">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Storyboard.TargetName="LayoutRoot"
                                            Storyboard.TargetProperty="Opacity"
                                            To="{ThemeResource ListViewItemDragThemeOpacity}"
                                            Duration="0" />
                                        <DragItemThemeAnimation TargetName="LayoutRoot" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="DraggingTarget" />

                                <VisualState x:Name="MultipleDraggingPrimary" />

                                <VisualState x:Name="MultipleDraggingSecondary" />

                                <VisualState x:Name="DraggedPlaceholder" />

                                <VisualState x:Name="Reordering">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Storyboard.TargetName="LayoutRoot"
                                            Storyboard.TargetProperty="Opacity"
                                            To="{ThemeResource ListViewItemReorderThemeOpacity}"
                                            Duration="0:0:0.240" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="ReorderingTarget">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Storyboard.TargetName="LayoutRoot"
                                            Storyboard.TargetProperty="Opacity"
                                            To="{ThemeResource ListViewItemReorderTargetThemeOpacity}"
                                            Duration="0:0:0.240" />
                                        <DoubleAnimation
                                            Storyboard.TargetName="LayoutRootScale"
                                            Storyboard.TargetProperty="ScaleX"
                                            To="{ThemeResource ListViewItemReorderTargetThemeScale}"
                                            Duration="0:0:0.240" />
                                        <DoubleAnimation
                                            Storyboard.TargetName="LayoutRootScale"
                                            Storyboard.TargetProperty="ScaleY"
                                            To="{ThemeResource ListViewItemReorderTargetThemeScale}"
                                            Duration="0:0:0.240" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="MultipleReorderingPrimary" />

                                <VisualState x:Name="ReorderedPlaceholder">
                                    <Storyboard>
                                        <FadeOutThemeAnimation TargetName="LayoutRoot" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="DragOver">
                                    <Storyboard>
                                        <DropTargetItemThemeAnimation TargetName="LayoutRoot" />
                                    </Storyboard>
                                </VisualState>

                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.2" To="NotDragging" />
                                </VisualStateGroup.Transitions>
                            </VisualStateGroup>

                            <!--  Controlled by AttachedProperty "IsCompact"  -->
                            <VisualStateGroup x:Name="TabStateModes">
                                <VisualState x:Name="FullTabState" />
                                <VisualState x:Name="CollapsedTabState">
                                    <VisualState.Setters>
                                        <Setter Target="ContentPresenter.Opacity" Value="0.4" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="CloseIconStates">
                                <VisualState x:Name="CloseButtonVisible" />
                                <VisualState x:Name="CloseButtonCollapsed">
                                    <VisualState.Setters>
                                        <Setter Target="CloseButton.Visibility" Value="Collapsed" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="CloseTabStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition From="CloseButtonDisabledState" To="CloseButtonEnabledState">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonContainer" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CloseButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)">
                                                <EasingDoubleKeyFrame KeyTime="0" Value="60" />
                                                <EasingDoubleKeyFrame KeyTime="0:0:0.05" Value="60" />
                                                <EasingDoubleKeyFrame KeyTime="0:0:0.325" Value="0">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <ExponentialEase EasingMode="EaseOut" Exponent="7" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition From="CloseButtonEnabledState" To="CloseButtonDisabledState">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonContainer" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CloseButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)">
                                                <EasingDoubleKeyFrame KeyTime="0" Value="0" />
                                                <EasingDoubleKeyFrame KeyTime="0:0:0.125" Value="60">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <ExponentialEase EasingMode="EaseIn" Exponent="7" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="CloseButtonEnabledState" />
                                <VisualState x:Name="CloseButtonDisabledState">
                                    <VisualState.Setters>
                                        <Setter Target="CloseButtonContainer.Visibility" Value="Collapsed" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup>
                                <VisualState x:Name="ForegroundNotSet" />
                                <VisualState x:Name="ForegroundSet">
                                    <VisualState.Setters>
                                        <Setter Target="ContentPresenter.Foreground" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Foreground}" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border
                            x:Name="TabSeparator"
                            Grid.Column="1"
                            Width="1"
                            Margin="{ThemeResource TabViewItemSeparatorMargin}"
                            HorizontalAlignment="Right"
                            BorderBrush="{ThemeResource TabViewItemSeparator}"
                            BorderThickness="1" />

                        <Grid Grid.Column="1">
                            <Border
                                x:Name="TabBackground"
                                h:CompositionFactory.EnableBounceScale="{Binding Tag, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                h:CompositionProperty.Translation="0 40"
                                Background="{ThemeResource TabViewItemHeaderBackgroundPointerOver}"
                                CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CornerRadius, Converter={StaticResource TopCornerRadiusFilterConverter}}" />
                            <Grid
                                x:Name="TabContainer"
                                Padding="{ThemeResource TabViewItemHeaderPadding}"
                                Control.IsTemplateFocusTarget="True"
                                FocusVisualMargin="{TemplateBinding FocusVisualMargin}">

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>

                                <!--
                                    If we template bind the ContentPresenter's Content property to the TabViewItem.Header property
                                    we unfortunately run into the following issue if the header is [null] or empty:
                                    The TabViewItem.Content property will be implicitly bound to the Content property of the ContentPresenter.
                                    To prevent this, we explicitly set a default empty content here and update the content in code behind.
                                -->
                                <ContentPresenter
                                    x:Name="ContentPresenter"
                                    Grid.Column="0"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                    Content=""
                                    ContentTemplate="{TemplateBinding HeaderTemplate}"
                                    ContentTransitions="{TemplateBinding ContentTransitions}"
                                    FontSize="{ThemeResource TabViewItemHeaderFontSize}"
                                    FontWeight="{TemplateBinding FontWeight}"
                                    Foreground="{ThemeResource TabViewItemHeaderForeground}"
                                    HighContrastAdjustment="None"
                                    IsHitTestVisible="False"
                                    OpticalMarginAlignment="TrimSideBearings" />


                                <Border x:Name="CloseButtonContainer" Grid.Column="1">
                                    <Button
                                        x:Name="CloseButton"
                                        core:Properties.ToolTipStyleKey="DefaultThemeToolTipStyle"
                                        Content="&#xE711;"
                                        HighContrastAdjustment="None"
                                        IsTabStop="False"
                                        IsTextScaleFactorEnabled="False"
                                        Style="{ThemeResource TabViewCloseButtonStyle}">
                                        <Button.RenderTransform>
                                            <CompositeTransform />
                                        </Button.RenderTransform>
                                    </Button>
                                </Border>
                            </Grid>

                        </Grid>

                        <Border
                            x:Name="SelectedBorder"
                            x:Load="False"
                            Grid.Column="1"
                            Margin="0 -1 0 2"
                            BorderBrush="{ThemeResource TabViewSelectedItemBorderBrush}"
                            BorderThickness="1 1 1 0"
                            CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CornerRadius, Converter={StaticResource TopCornerRadiusFilterConverter}}"
                            IsHitTestVisible="False"
                            Visibility="Collapsed" />

                        <Path
                            x:Name="LeftRadiusRenderArc"
                            x:Load="False"
                            Width="4"
                            Height="4"
                            Margin="-4,0,-2,0"
                            VerticalAlignment="Bottom"
                            Data="M4 0C4 1.19469 3.47624 2.26706 2.64582 3H0C1.65685 3 3 1.65685 3 0H4Z"
                            Fill="{ThemeResource CardStrokeColorDefault}"
                            Visibility="Collapsed" />

                        <Path
                            x:Name="LeftRadiusRenderTriangle"
                            x:Load="False"
                            Margin="-3,0,-1,0"
                            VerticalAlignment="Bottom"
                            Data="M0 4H4V0C4 2.20914 2.20914 4 0 4Z"
                            Fill="{ThemeResource TabViewItemHeaderBackgroundSelected}"
                            Visibility="Collapsed" />

                        <Path
                            x:Name="RightRadiusRenderArc"
                            x:Load="False"
                            Grid.Column="2"
                            Width="4"
                            Height="4"
                            Margin="-2,0,-4,0"
                            VerticalAlignment="Bottom"
                            Data="M0 0C0 1.19469 0.523755 2.26706 1.35418 3H4C2.34315 3 1 1.65685 1 0H0Z"
                            Fill="{ThemeResource CardStrokeColorDefault}"
                            Visibility="Collapsed" />

                        <Path
                            x:Name="RightRadiusRenderTriangle"
                            x:Load="False"
                            Grid.Column="2"
                            Margin="-1,0,-4,0"
                            VerticalAlignment="Bottom"
                            Data="M4 4H0V0C0 2.20914 1.79086 4 4 4Z"
                            Fill="{ThemeResource TabViewItemHeaderBackgroundSelected}"
                            Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>
