123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- <SolidColorBrush x:Key="TabItem.Selected.Background" Color="#FFFFFF"/>
- <SolidColorBrush x:Key="TabItem.Selected.Border" Color="#ACACAC"/>
- <Style x:Key="TabControlStyle1" TargetType="{x:Type TabControl}">
- <Setter Property="Padding" Value="2"/>
- <Setter Property="HorizontalContentAlignment" Value="Center"/>
- <Setter Property="VerticalContentAlignment" Value="Center"/>
- <Setter Property="Background" Value="{StaticResource TabItem.Selected.Background}"/>
- <Setter Property="BorderBrush" Value="{StaticResource TabItem.Selected.Border}"/>
- <Setter Property="BorderThickness" Value="1"/>
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type TabControl}">
- <Grid x:Name="templateRoot" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
- <Grid.ColumnDefinitions>
- <ColumnDefinition x:Name="ColumnDefinition0"/>
- <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition x:Name="RowDefinition0" Height="Auto"/>
- <RowDefinition x:Name="RowDefinition1" Height="*"/>
- </Grid.RowDefinitions>
- <UniformGrid x:Name="headerPanel" Background="Transparent" Grid.Column="0" HorizontalAlignment="Stretch" IsItemsHost="true" Margin="2,2,2,0" Grid.Row="0" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1" Rows="1"/>
- <Border x:Name="contentPanel" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
- <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="TabStripPlacement" Value="Bottom">
- <Setter Property="Grid.Row" TargetName="headerPanel" Value="1"/>
- <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/>
- <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
- <Setter Property="Height" TargetName="RowDefinition1" Value="Auto"/>
- <Setter Property="Margin" TargetName="headerPanel" Value="2,0,2,2"/>
- </Trigger>
- <Trigger Property="TabStripPlacement" Value="Left">
- <Setter Property="Grid.Row" TargetName="headerPanel" Value="0"/>
- <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/>
- <Setter Property="Grid.Column" TargetName="headerPanel" Value="0"/>
- <Setter Property="Grid.Column" TargetName="contentPanel" Value="1"/>
- <Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto"/>
- <Setter Property="Width" TargetName="ColumnDefinition1" Value="*"/>
- <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
- <Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
- <Setter Property="Margin" TargetName="headerPanel" Value="2,2,0,2"/>
- </Trigger>
- <Trigger Property="TabStripPlacement" Value="Right">
- <Setter Property="Grid.Row" TargetName="headerPanel" Value="0"/>
- <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/>
- <Setter Property="Grid.Column" TargetName="headerPanel" Value="1"/>
- <Setter Property="Grid.Column" TargetName="contentPanel" Value="0"/>
- <Setter Property="Width" TargetName="ColumnDefinition0" Value="*"/>
- <Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto"/>
- <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
- <Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
- <Setter Property="Margin" TargetName="headerPanel" Value="0,2,2,2"/>
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="LineTabControlStyle" TargetType="{x:Type TabControl}">
- <Setter Property="Background" Value="#ffffff"></Setter>
- <Setter Property="BorderThickness" Value="0"></Setter>
- <Setter Property="BorderBrush" Value="Transparent"></Setter>
- <Setter Property="Padding" Value="5"></Setter>
- <Setter Property="VerticalAlignment" Value="Center"></Setter>
- <Setter Property="HorizontalAlignment" Value="Center"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type TabControl}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="50"></RowDefinition>
- <RowDefinition Height="*"></RowDefinition>
- </Grid.RowDefinitions>
- <TabPanel Grid.Row="0"
- Panel.ZIndex="1"
- Background="Transparent"
- IsItemsHost="True"
- HorizontalAlignment="Center"></TabPanel>
- <Border Grid.Row="1"
- CornerRadius="5"
- BorderThickness="{TemplateBinding BorderThickness}"
- BorderBrush="{TemplateBinding BorderBrush}"
- Background="{TemplateBinding Background}">
- <ContentPresenter ContentSource="SelectedContent"
- SnapsToDevicePixels="True"
- Margin="{TemplateBinding Padding}"></ContentPresenter>
- </Border>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|