<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:smart="clr-namespace:SmartUI.Controls">
    <Style x:Key="DefaultTabControlStyle" TargetType="TabControl">
        <Setter Property="Margin" Value="8"/>
        <Setter Property="BorderBrush" Value="{DynamicResource BorderBaseColor}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid KeyboardNavigation.TabNavigation="Local">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                                            <EasingColorKeyFrame KeyTime="0" Value="#FFAAAAAA" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border BorderBrush="{TemplateBinding BorderBrush}" Panel.ZIndex="1" Width="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=ActualWidth}" Grid.Row="0" BorderThickness="0 0 0 2">
                            <TabPanel x:Name="HeaderPanel" Margin="0,0,4,-2" IsItemsHost="True" KeyboardNavigation.TabIndex="1" Background="Transparent" />
                        </Border>                      
                        <Border x:Name="Border" Grid.Row="1" BorderThickness="0 0 0 0" BorderBrush="{TemplateBinding BorderBrush}" KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.DirectionalNavigation="Contained"  KeyboardNavigation.TabIndex="2">
                            <ContentPresenter x:Name="PART_SelectedContentHost" Margin="4" ContentSource="SelectedContent" />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="TabControl" BasedOn="{StaticResource DefaultTabControlStyle}"/>
    <Style x:Key="DefaultTabItemStyle" TargetType="TabItem">
        <Setter Property="MinWidth" Value="100"/>
        <Setter Property="Height" Value="40"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TabItem">
                    <Border x:Name="border" SnapsToDevicePixels="True" ClipToBounds="True" BorderThickness="0 0 0 2" Background="White"  CornerRadius="0"  BorderBrush="{DynamicResource BorderBaseColor}">
                        <ContentPresenter x:Name="contentPresenter" 
                                              ContentSource="Header"
                                              Focusable="False" 
                                              HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" 
                                              Margin="{TemplateBinding Padding}" 
                                              RecognizesAccessKey="True" 
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                              VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}">
                        </ContentPresenter>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource BrandColor}"/>
                            <Setter Property="Foreground" Value="{DynamicResource BrandColor}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="TabItem" BasedOn="{StaticResource DefaultTabItemStyle}"/>
</ResourceDictionary>