123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- <Style x:Key="FocusVisual">
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <LinearGradientBrush x:Key="TabItem.Static.Background" EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#F0F0F0" Offset="0.0"/>
- <GradientStop Color="#E5E5E5" Offset="1.0"/>
- </LinearGradientBrush>
- <SolidColorBrush x:Key="TabItem.Static.Border" Color="#ACACAC"/>
- <LinearGradientBrush x:Key="TabItem.MouseOver.Background" EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#ECF4FC" Offset="0.0"/>
- <GradientStop Color="#DCECFC" Offset="1.0"/>
- </LinearGradientBrush>
- <SolidColorBrush x:Key="TabItem.MouseOver.Border" Color="#7EB4EA"/>
- <SolidColorBrush x:Key="TabItem.Selected.Background1" Color="#1460F3"/>
- <SolidColorBrush x:Key="TabItem.Selected.Border1" Color="#ACACAC"/>
- <SolidColorBrush x:Key="TabItem.Disabled.Background" Color="#1460F3"/>
- <SolidColorBrush x:Key="TabItem.Disabled.Border" Color="#D9D9D9"/>
- <Style x:Key="TabItemStyle1" TargetType="{x:Type TabItem}">
- <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
- <Setter Property="Foreground" Value="Black"/>
- <Setter Property="Background" Value="{StaticResource TabItem.Static.Background}"/>
- <Setter Property="BorderBrush" Value="{StaticResource TabItem.Static.Border}"/>
- <Setter Property="Margin" Value="0"/>
- <Setter Property="Padding" Value="6,2,6,2"/>
- <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
- <Setter Property="VerticalContentAlignment" Value="Stretch"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type TabItem}">
- <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
- <Border x:Name="mainBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Margin="0">
- <Border x:Name="innerBorder" Background="{StaticResource TabItem.Selected.Background1}" BorderBrush="{StaticResource TabItem.Selected.Border1}" BorderThickness="1,1,1,0" Margin="-1" Opacity="0"/>
- </Border>
- <ContentPresenter x:Name="contentPresenter" ContentSource="Header" Focusable="False" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
- </Grid>
- <ControlTemplate.Triggers>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
- <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
- <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
- <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
- <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
- <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
- <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
- <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
- <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
- <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
- <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
- <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
- <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Panel.ZIndex" Value="1"/>
- <Setter Property="Margin" Value="-2,-2,0,-2"/>
- <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Panel.ZIndex" Value="1"/>
- <Setter Property="Margin" Value="-2,0,-2,-2"/>
- <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Panel.ZIndex" Value="1"/>
- <Setter Property="Margin" Value="0,-2,-2,-2"/>
- <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/>
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Panel.ZIndex" Value="1"/>
- <Setter Property="Margin" Value="-2,-2,-2,0"/>
- <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
- <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/>
- <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/>
- </MultiDataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|