123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- >
- <!--通用TabControl样式-->
- <Style TargetType="{x:Type TabControl}" x:Key="LargeTab">
- <!--<Setter Property="Background" Value="#FFC5D0D8"/>-->
- <Setter Property="Background" Value="#669ACC"/>
- <Setter Property="FontFamily" Value="Arial,SimSun"/>
- </Style>
- <!--通用TabItem样式-->
- <Style TargetType="TabItem">
- <Setter Property="FrameworkElement.FocusVisualStyle">
- <Setter.Value>
- <Style TargetType="Control">
- <Style.Resources>
- <ResourceDictionary />
- </Style.Resources>
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Border>
- <Rectangle StrokeThickness="0" />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- </Style>
- <!--通用TabControl样式-->
- <Style TargetType="{x:Type TabControl}" >
- <!--<Setter Property="Background" Value="#FFC5D0D8"/>-->
- <Setter Property="Background" Value="#669ACC"/>
- <Setter Property="FontFamily" Value="Arial,SimSun"/>
- <Setter Property="FontSize" Value="17"></Setter>
- <Setter Property="ItemContainerStyle">
- <Setter.Value>
- <Style>
- <Setter Property="Control.Height" Value="24"></Setter>
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type TabItem}">
- <Grid Margin="0 0 -10 0">
- <Path Data="M190 0 L 0 0 L 10 23 L 170 23 L 190 0" StrokeThickness="1" Fill="{TemplateBinding Background}"
- Stroke="Black">
- </Path>
- <ContentPresenter Margin="10 3 10 0" ContentSource="Header" Cursor="Hand" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Trigger.Setters>
- <Setter Property="Background" Value="#FFCBD8D8"></Setter>
- <Setter Property="Panel.ZIndex" Value="1"></Setter>
- </Trigger.Setters>
- </Trigger>
- <Trigger Property="IsSelected" Value="False">
- <Trigger.Setters>
- <Setter Property="Background" Value="#FFA7ADAD"></Setter>
- </Trigger.Setters>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type TabControl}">
- <Grid ClipToBounds="True" KeyboardNavigation.TabNavigation="Local" SnapsToDevicePixels="True">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Name="ColumnDefinition0" Width="*"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Name="RowDefinition0" />
- <RowDefinition Name="RowDefinition1" Height="25"/>
- </Grid.RowDefinitions>
- <StackPanel Name="HeaderPanel"
- Orientation="Horizontal"
- Grid.Row="1"
- Background="#40a8c4"
- Margin="0,0,0,0"
- Panel.ZIndex="1"
- IsItemsHost="True"
- KeyboardNavigation.TabIndex="1"/>
- <Border Name="ContentPanel"
- Grid.Row="0"
- Background="{TemplateBinding Panel.Background}"
- BorderBrush="{TemplateBinding Border.BorderBrush}"
- BorderThickness="{TemplateBinding Border.BorderThickness}"
- KeyboardNavigation.DirectionalNavigation="Contained"
- KeyboardNavigation.TabIndex="2"
- KeyboardNavigation.TabNavigation="Local">
- <ContentPresenter Name="PART_SelectedContentHost"
- Margin="{TemplateBinding Control.Padding}"
- Content="{TemplateBinding TabControl.SelectedContent}"
- ContentSource="SelectedContent"
- ContentStringFormat="{TemplateBinding TabControl.SelectedContentStringFormat}"
- ContentTemplate="{TemplateBinding TabControl.SelectedContentTemplate}"
- SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"/>
- </Border>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <!--设置TabControl模版样式-->
- <ControlTemplate x:Key="TabStackPanelControlTemplate" TargetType="{x:Type TabControl}">
- <Grid ClipToBounds="True" KeyboardNavigation.TabNavigation="Local" SnapsToDevicePixels="True">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Name="ColumnDefinition0" Width="*"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Name="RowDefinition0" />
- <RowDefinition Name="RowDefinition1" Height="25"/>
- </Grid.RowDefinitions>
- <StackPanel Name="HeaderPanel"
- Orientation="Horizontal"
- Grid.Row="1"
- Background="#2c4746"
- Margin="0,0,0,0"
- Panel.ZIndex="1"
- IsItemsHost="True"
- KeyboardNavigation.TabIndex="1"/>
- <Border Name="ContentPanel"
- Grid.Row="0"
-
- BorderBrush="{TemplateBinding Border.BorderBrush}"
- BorderThickness="{TemplateBinding Border.BorderThickness}"
- KeyboardNavigation.DirectionalNavigation="Contained"
- KeyboardNavigation.TabIndex="2"
- KeyboardNavigation.TabNavigation="Local">
- <ContentPresenter Name="PART_SelectedContentHost"
- Margin="{TemplateBinding Control.Padding}"
- Content="{TemplateBinding TabControl.SelectedContent}"
- ContentSource="SelectedContent"
- ContentStringFormat="{TemplateBinding TabControl.SelectedContentStringFormat}"
- ContentTemplate="{TemplateBinding TabControl.SelectedContentTemplate}"
- SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"/>
- </Border>
- </Grid>
- </ControlTemplate>
- <!--SmartProcess-->
- <Style TargetType="{x:Type TabItem}" x:Key="TabItemSmartProcess">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type TabItem}">
- <Grid>
- <Border
- Name="Border"
- Background="#FFC2E4F6"
- BorderBrush="Gray"
- BorderThickness="1,1,1,1"
- CornerRadius="6,6,0,0" >
- <ContentPresenter x:Name="ContentSite"
- VerticalAlignment="Center"
- HorizontalAlignment="Center"
- ContentSource="Header"
- Margin="12,2,12,2"/>
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Setter TargetName="Border" Property="Background" Value="#FFC2E4F6" />
- </Trigger>
- <Trigger Property="IsSelected" Value="False">
- <Setter TargetName="Border" Property="Background" Value="Transparent" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <!--设置选项卡大小-->
- <Style TargetType="{x:Type TabControl}" x:Key="ChromeLargeTab">
- <Setter Property="Background" Value="#FFC5D0D8">
- </Setter>
- <Setter Property="FontSize" Value="17"></Setter>
- <Setter Property="ItemContainerStyle">
- <Setter.Value>
- <Style>
- <Setter Property="Control.Height" Value="24"></Setter>
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type TabItem}">
- <!--"M60 0 L 0 0 L 10 23 L 45 23 L 60 0"-->
- <Grid Margin="0 0 -10 0">
- <Path Data="M120 0 L 0 0 L 10 23 L 90 23 L 120 0" StrokeThickness="1" Fill="{TemplateBinding Background}"
- Stroke="Black">
- </Path>
- <ContentPresenter Margin="10 3 10 0" ContentSource="Header" Cursor="Hand" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Trigger.Setters>
- <Setter Property="Background" Value="#FFCBD8D8"></Setter>
- <Setter Property="Panel.ZIndex" Value="1"></Setter>
- </Trigger.Setters>
- </Trigger>
- <Trigger Property="IsSelected" Value="False">
- <Trigger.Setters>
- <Setter Property="Background" Value="#FFA7ADAD"></Setter>
- </Trigger.Setters>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- </Style>
- <Style TargetType="{x:Type TabControl}" x:Key="ChromeTabSmall">
- <Setter Property="Background" Value="#FFC5D0D8">
- </Setter>
- <Setter Property="FontSize" Value="17"></Setter>
- <Setter Property="ItemContainerStyle">
- <Setter.Value>
- <Style>
- <Setter Property="Control.Height" Value="24"></Setter>
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type TabItem}">
- <Grid Margin="0 0 -10 0">
- <Path Data="M60 0 L 0 0 L 10 23 L 45 23 L 60 0" StrokeThickness="1" Fill="{TemplateBinding Background}"
- Stroke="Black">
- </Path>
- <ContentPresenter Margin="8 3 7 0" ContentSource="Header" Cursor="Hand" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Trigger.Setters>
- <Setter Property="Background" Value="#FFCBD8D8"></Setter>
- <Setter Property="Panel.ZIndex" Value="1"></Setter>
- </Trigger.Setters>
- </Trigger>
- <Trigger Property="IsSelected" Value="False">
- <Trigger.Setters>
- <Setter Property="Background" Value="#FFA7ADAD"></Setter>
- </Trigger.Setters>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- </Style>
- <Style TargetType="{x:Type TabItem}" x:Key="Main_TabItem">
- <Setter Property="SnapsToDevicePixels" Value="True"/>
- <Setter Property="FocusVisualStyle" Value="{StaticResource TabItemFocusVisual}"/>
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Foreground" Value="{DynamicResource SubMenu_FG}"/>
- <Setter Property="FontFamily" Value="Arial"/>
- <Setter Property="MinWidth" Value="100"/>
- <Setter Property="Height" Value="25"/>
- <Setter Property="FontSize" Value="14"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type TabItem}">
- <Border x:Name="BG" BorderBrush="{DynamicResource SubMenu_BD_Shadow}" BorderThickness="0,0,2,2" CornerRadius="0,0,5,5" Background="{DynamicResource SubMenu_BG}" Cursor="Hand">
- <Border x:Name="InnerBD" BorderBrush="{DynamicResource SubMenu_BD_Highlight}" BorderThickness="2,0,0,0" CornerRadius="0,0,4,4">
- <ContentPresenter x:Name="Content" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="6,0"/>
- </Border>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true" SourceName="BG">
- <Setter Property="Background" TargetName="BG" Value="{DynamicResource SubMenu_BG_MouseOver}"/>
- <Setter Property="Foreground" Value="{DynamicResource SubMenu_FG_Select}"/>
- </Trigger>
- <Trigger Property="IsSelected" Value="true">
- <Setter Property="Background" TargetName="BG" Value="{DynamicResource SubMenu_BG_Select}"/>
- <Setter Property="BorderBrush" TargetName="BG" Value="{DynamicResource SubMenu_BD_Shadow_Select}"/>
- <Setter Property="BorderBrush" TargetName="InnerBD" Value="{DynamicResource SubMenu_BD_Highlight}"/>
- <Setter Property="Foreground" Value="{DynamicResource SubMenu_FG_Select}"/>
- <Setter Property="FontSize" Value="16"/>
- <Setter Property="Effect" TargetName="Content">
- <Setter.Value>
- <DropShadowEffect BlurRadius="5" Color="White" ShadowDepth="0"/>
- </Setter.Value>
- </Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|