GageTab.xaml 4.65 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
潘栩锋's avatar
潘栩锋 committed
3
    <ControlTemplate x:Key="GageTab" TargetType="{x:Type TabControl}">
潘栩锋's avatar
潘栩锋 committed
4 5 6 7 8
        <ControlTemplate.Resources>
            <Style TargetType="{x:Type TabItem}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabItem}">
潘栩锋's avatar
潘栩锋 committed
9
                            <Grid SnapsToDevicePixels="True" Margin="0">
潘栩锋's avatar
潘栩锋 committed
10 11 12 13 14 15
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup Name="SelectionStates">
                                        <VisualState Name="Selected">
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetName="buttonShape" Storyboard.TargetProperty="Opacity" 
                                                                 To="1" Duration="0:0:.3"/>
潘栩锋's avatar
潘栩锋 committed
16

潘栩锋's avatar
潘栩锋 committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
                                                <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>
潘栩锋's avatar
潘栩锋 committed
34 35 36
                                <Border Name="buttonBackgroundShape" Opacity="0"  Background="#FFa3a3a6" />
                                <Border Name="buttonShape" Opacity="0" Background="Black"  />

潘栩锋's avatar
潘栩锋 committed
37 38 39 40 41 42 43 44
                                <!--<ContentPresenter Name="buttonText" 
                                                  TextBlock.FontFamily="Calibri"
                                                  TextBlock.FontSize="12pt"
                                                  TextBlock.Foreground="White"
                                                  Margin="20"
                                                  Content="{TemplateBinding Header}"
                                                  VerticalAlignment="Center"/>-->
                                <TextBlock Name="buttonText" 
潘栩锋's avatar
潘栩锋 committed
45 46 47
                                           FontFamily="Calibri"
                                           FontSize="24"
                                           Foreground="White"
潘栩锋's avatar
潘栩锋 committed
48 49
                                                  Margin="20"
                                                  Text="{TemplateBinding Header}"
潘栩锋's avatar
潘栩锋 committed
50 51 52 53 54
                                                  VerticalAlignment="Center">
                                    <TextBlock.LayoutTransform >
                                        <RotateTransform Angle="270"/>
                                    </TextBlock.LayoutTransform>
                                </TextBlock>
潘栩锋's avatar
潘栩锋 committed
55
                            </Grid>
潘栩锋's avatar
潘栩锋 committed
56

潘栩锋's avatar
潘栩锋 committed
57 58 59 60 61 62
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ControlTemplate.Resources>
        <Grid SnapsToDevicePixels="True" >
潘栩锋's avatar
潘栩锋 committed
63 64 65 66
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
潘栩锋's avatar
潘栩锋 committed
67
            <StackPanel IsItemsHost="True" 
潘栩锋's avatar
潘栩锋 committed
68 69 70
                        Orientation="Vertical"
                        Background="#bcbcbc"
                        />
潘栩锋's avatar
潘栩锋 committed
71 72
            <ContentPresenter 
                Content="{TemplateBinding SelectedContent}" 
潘栩锋's avatar
潘栩锋 committed
73
                Grid.Column="1" />
潘栩锋's avatar
潘栩锋 committed
74 75 76
        </Grid>
    </ControlTemplate>
</ResourceDictionary>