<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    <ControlTemplate x:Key="GraphTab" TargetType="{x:Type TabControl}">
        <ControlTemplate.Resources>
            <Style TargetType="{x:Type TabItem}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabItem}">
                            <Grid SnapsToDevicePixels="True" >
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup Name="CommonStates">
                                        <VisualState Name="MouseOver">
                                            <Storyboard>
                                                <ThicknessAnimation Storyboard.TargetName="buttonShape" 
                                                                 Storyboard.TargetProperty="Margin" To="0" Duration="0:0:.1"/>
                                                <ThicknessAnimation Storyboard.TargetName="buttonBackgroundShape" 
                                                                 Storyboard.TargetProperty="Margin" To="0" Duration="0:0:.1"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState Name="Normal">
                                            <Storyboard>
                                                <ThicknessAnimation Storyboard.TargetName="buttonShape" 
                                                                 Storyboard.TargetProperty="Margin" To="5" Duration="0:0:.1"/>
                                                <ThicknessAnimation Storyboard.TargetName="buttonBackgroundShape" 
                                                                 Storyboard.TargetProperty="Margin" To="5" Duration="0:0:.1"/>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                    <VisualStateGroup Name="SelectionStates">
                                        <VisualState Name="Selected">
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetName="buttonShape" Storyboard.TargetProperty="Opacity" 
                                                                 To="1" Duration="0:0:.3"/>

                                                <DoubleAnimation Storyboard.TargetName="buttonBackgroundShape" Storyboard.TargetProperty="Opacity" 
                                                                 To="1" Duration="0"/>
                                                <!-- 
                                                <ColorAnimation Storyboard.TargetName="buttonText" 
                                                                Storyboard.TargetProperty= "(TextBlock.Foreground).(SolidColorBrush.Color)" 
                                                                To="White" Duration="0:0:.1" />
                                                -->
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState Name="Unselected">
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetName="buttonShape" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:.1"/>
                                                <DoubleAnimation Storyboard.TargetName="buttonBackgroundShape" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:.1"/>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Border Name="buttonBackgroundShape" Opacity="0" BorderThickness="0,2" Background="{StaticResource Color_theme_static}" Margin="5"/>
                                <Border Name="buttonShape" Opacity="0" BorderThickness="0,2" Background="{StaticResource Color_theme_activity}" Margin="5" />

                                <!--<ContentPresenter Name="buttonText" 
                                                  TextBlock.FontFamily="Calibri"
                                                  TextBlock.FontSize="12pt"
                                                  TextBlock.Foreground="White"
                                                  Margin="20"
                                                  Content="{TemplateBinding Header}"
                                                  VerticalAlignment="Center"/>-->
                                <TextBlock Name="buttonText" 
                                                  TextBlock.FontFamily="Calibri"
                                                  TextBlock.FontSize="12pt"
                                                  TextBlock.Foreground="White"
                                                  Margin="20"
                                                  Text="{TemplateBinding Header}"
                                                  VerticalAlignment="Center"/>
                            </Grid>

                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ControlTemplate.Resources>
        <Grid SnapsToDevicePixels="True" >
            <Grid.RowDefinitions>
                <RowDefinition Height="auto" />
                <RowDefinition/>
            </Grid.RowDefinitions>
            <StackPanel IsItemsHost="True" 
                        Orientation="Horizontal"
                        Margin="0,0,-1,0" />
            <ContentPresenter 
                Content="{TemplateBinding SelectedContent}" 
                Grid.Row="1" />
        </Grid>
    </ControlTemplate>
    <Style TargetType="TabControl"  x:Key="GraphTabStyle">
        <Setter Property="Template" Value="{StaticResource GraphTab}"/>
    </Style>

</ResourceDictionary>