GraphTab.xaml 6.16 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

潘栩锋's avatar
潘栩锋 committed
4 5 6 7 8 9 10 11 12
    <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}">
潘栩锋's avatar
潘栩锋 committed
13
                            <Grid SnapsToDevicePixels="True" >
潘栩锋's avatar
潘栩锋 committed
14 15 16 17
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup Name="CommonStates">
                                        <VisualState Name="MouseOver">
                                            <Storyboard>
18
                                                <ThicknessAnimation Storyboard.TargetName="grid_background" 
潘栩锋's avatar
潘栩锋 committed
19 20 21 22 23
                                                                 Storyboard.TargetProperty="Margin" To="0" Duration="0:0:.1"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState Name="Normal">
                                            <Storyboard>
24
                                                <ThicknessAnimation Storyboard.TargetName="grid_background" 
潘栩锋's avatar
潘栩锋 committed
25 26 27 28 29 30 31
                                                                 Storyboard.TargetProperty="Margin" To="5" Duration="0:0:.1"/>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                    <VisualStateGroup Name="SelectionStates">
                                        <VisualState Name="Selected">
                                            <Storyboard>
32
                                                <DoubleAnimation Storyboard.TargetName="grid_selected" Storyboard.TargetProperty="Opacity" 
潘栩锋's avatar
潘栩锋 committed
33
                                                                 To="1" Duration="0:0:.3"/>
潘栩锋's avatar
潘栩锋 committed
34

35 36
                                                <DoubleAnimation Storyboard.TargetName="grid_unselected" Storyboard.TargetProperty="Opacity" 
                                                                 To="0" Duration="0"/>
潘栩锋's avatar
潘栩锋 committed
37 38 39 40
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState Name="Unselected">
                                            <Storyboard>
41 42
                                                <DoubleAnimation Storyboard.TargetName="grid_selected" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:.1"/>
                                                <DoubleAnimation Storyboard.TargetName="grid_unselected" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:.1"/>
潘栩锋's avatar
潘栩锋 committed
43
                                            </Storyboard>
44
                                            
潘栩锋's avatar
潘栩锋 committed
45 46 47
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
                                <Grid Name="grid_background" Margin="5" >
                                    <Grid Name="grid_unselected" Opacity="0" >
                                        <Border Background="{StaticResource  Color_theme_noact}" 
                                                CornerRadius="3" />
                                    </Grid>
                                    <Grid Name="grid_selected" Opacity="0" >
                                        <Border Background="{StaticResource Color_theme_activity}" 
                                                CornerRadius="3" />
                                        <Rectangle VerticalAlignment="Bottom" Margin="10,0"
                                        Height="4" Fill="LightGray"/>
                                    </Grid>
                                    <!--<Grid.Style>
                                        <Style TargetType="Grid">
                                            <Setter Property="Effect">
                                                <Setter.Value>
                                                    <DropShadowEffect Color="Black" Direction="270" ShadowDepth="1" Opacity="0.23" />
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </Grid.Style>-->
                                </Grid>
潘栩锋's avatar
潘栩锋 committed
69

70
                                
潘栩锋's avatar
潘栩锋 committed
71 72 73 74 75 76 77 78
                                <TextBlock Name="buttonText" 
                                                  TextBlock.FontFamily="Calibri"
                                                  TextBlock.FontSize="12pt"
                                                  TextBlock.Foreground="White"
                                                  Margin="20"
                                                  Text="{TemplateBinding Header}"
                                                  VerticalAlignment="Center"/>
                            </Grid>
潘栩锋's avatar
潘栩锋 committed
79

潘栩锋's avatar
潘栩锋 committed
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
                        </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>
潘栩锋's avatar
潘栩锋 committed
98 99 100 101
    <Style TargetType="TabControl"  x:Key="GraphTabStyle">
        <Setter Property="Template" Value="{StaticResource GraphTab}"/>
    </Style>

潘栩锋's avatar
潘栩锋 committed
102
</ResourceDictionary>