GageTab.xaml 4.65 KB
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ControlTemplate x:Key="GageTab" TargetType="{x:Type TabControl}">
        <ControlTemplate.Resources>
            <Style TargetType="{x:Type TabItem}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabItem}">
                            <Grid SnapsToDevicePixels="True" Margin="0">
                                <VisualStateManager.VisualStateGroups>
                                    <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"  Background="#FFa3a3a6" />
                                <Border Name="buttonShape" Opacity="0" Background="Black"  />

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

                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ControlTemplate.Resources>
        <Grid SnapsToDevicePixels="True" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <StackPanel IsItemsHost="True" 
                        Orientation="Vertical"
                        Background="#bcbcbc"
                        />
            <ContentPresenter 
                Content="{TemplateBinding SelectedContent}" 
                Grid.Column="1" />
        </Grid>
    </ControlTemplate>
</ResourceDictionary>