123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548 |
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:cus="clr-namespace:PDF_Office.CustomControl">
- <Style x:Key="TabControlWithUnderLineStyle" TargetType="{x:Type TabControl}">
- <Setter Property="Padding" Value="2" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="#FFACACAC" />
- <Setter Property="BorderThickness" Value="0,0,0,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"
- KeyboardNavigation.TabNavigation="Local"
- SnapsToDevicePixels="True">
- <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>
- <!-- 加滑轨配合滑轨样式可实现箭头左右滚动的菜单栏 -->
- <!--<ScrollViewer Margin="140 0 140 0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">-->
- <TabPanel
- x:Name="HeaderPanel"
- Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
- VerticalAlignment="{TemplateBinding VerticalAlignment}"
- Panel.ZIndex="1"
- Background="Transparent"
- IsItemsHost="True"
- KeyboardNavigation.TabIndex="1" />
- <!--</ScrollViewer>-->
- <!-- 页头和中间内容的分割线 -->
- <Line
- Margin="0,0,0,1"
- VerticalAlignment="Bottom"
- SnapsToDevicePixels="True"
- Stroke="#E7E9EC"
- StrokeThickness="0"
- X1="0"
- X2="{Binding ActualWidth, RelativeSource={RelativeSource Self}}" />
- <Border
- x:Name="ContentPanel"
- Grid.Row="1"
- Grid.Column="0"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- KeyboardNavigation.DirectionalNavigation="Contained"
- KeyboardNavigation.TabIndex="2"
- KeyboardNavigation.TabNavigation="Local">
- <ContentPresenter
- x:Name="PART_SelectedContentHost"
- Margin="0"
- VerticalAlignment="Stretch"
- Content="{TemplateBinding SelectedContent}"
- ContentSource="SelectedContent"
- ContentStringFormat="{TemplateBinding SelectedContentStringFormat}"
- ContentTemplate="{TemplateBinding SelectedContentTemplate}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="TabStripPlacement" Value="Bottom">
- <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="1" />
- <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
- <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
- <Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
- </Trigger>
- <Trigger Property="TabStripPlacement" Value="Left">
- <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
- <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
- <Setter TargetName="HeaderPanel" Property="Grid.Column" Value="0" />
- <Setter TargetName="ContentPanel" Property="Grid.Column" Value="1" />
- <Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
- <Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
- <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
- <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
- <Setter TargetName="HeaderPanel" Property="VerticalAlignment" Value="Top" />
- </Trigger>
- <Trigger Property="TabStripPlacement" Value="Right">
- <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
- <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
- <Setter TargetName="HeaderPanel" Property="Grid.Column" Value="1" />
- <Setter TargetName="ContentPanel" Property="Grid.Column" Value="0" />
- <Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
- <Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
- <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
- <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle" />
- <Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle" />
- </Style>
- <Style x:Key="TabItem_WithUnderLineStyle" TargetType="{x:Type cus:IconAndTextTabItem}">
- <Setter Property="Foreground" Value="Black" />
- <Setter Property="Background" Value="White" />
- <Setter Property="BorderBrush" Value="#FFACACAC" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="AllowDrop" Value="True" />
- <Setter Property="SelectedForeground" Value="Black" />
- <Setter Property="FontSize" Value="14" />
- <Setter Property="Height" Value="40" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type cus:IconAndTextTabItem}">
- <Grid
- x:Name="templateRoot"
- Margin="{TemplateBinding Padding}"
- Background="Transparent"
- SnapsToDevicePixels="True">
- <Border
- x:Name="_underline"
- HorizontalAlignment="Stretch"
- BorderBrush="#FF477EDE"
- BorderThickness="0" />
- <StackPanel Orientation="Horizontal">
- <Path
- x:Name="NormalPathIcon"
- MaxWidth="20"
- MaxHeight="20"
- Margin="0,0,4,0"
- Data="{Binding NormalPathIcon, RelativeSource={RelativeSource Mode=TemplatedParent}}"
- Fill="Black"
- Visibility="Visible" />
- <Image
- x:Name="SelectedIcon"
- MaxWidth="20"
- MaxHeight=" 20"
- Margin="0,0,4,0"
- Source="{Binding SelectedIcon, RelativeSource={RelativeSource Mode=TemplatedParent}}"
- Visibility="Collapsed" />
- <TextBlock
- x:Name="txt"
- Margin="0,0,4,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="{TemplateBinding Foreground}"
- Text="{TemplateBinding Header}"
- TextTrimming="CharacterEllipsis"
- ToolTip="{TemplateBinding Header}"
- Visibility="Visible" />
- </StackPanel>
- </Grid>
- <ControlTemplate.Triggers>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="SelectedIcon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="NormalPathIcon" Property="Visibility" Value="Visible" />
- <Setter TargetName="txt" Property="Foreground" Value="#FF000000" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="templateRoot" Property="Opacity" Value="0.56" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="templateRoot" Property="Opacity" Value="0.56" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="templateRoot" Property="Opacity" Value="0.56" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="templateRoot" Property="Opacity" Value="0.56" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="NormalPathIcon" Property="Opacity" Value="0.56" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
- </MultiDataTrigger.Conditions>
- <Setter Property="Panel.ZIndex" Value="1" />
- <Setter TargetName="txt" Property="Foreground" Value="{Binding SelectedForeground, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
- <Setter TargetName="_underline" Property="BorderThickness" Value="0,0,0,2" />
- <Setter TargetName="SelectedIcon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="NormalPathIcon" Property="Visibility" Value="Visible" />
- </MultiDataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- Design Token TabItem ControlTemplate for Forms Property Title -->
- <ControlTemplate x:Key="Segmented" TargetType="{x:Type TabItem}">
- <Grid x:Name="templateRoot" SnapsToDevicePixels="True">
- <Border
- x:Name="mainBorder"
- Margin="0"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="0">
- <Border
- x:Name="innerBorder"
- Height="28"
- Margin="-1"
- Background="White"
- BorderBrush="#FFACACAC"
- BorderThickness="0"
- CornerRadius="4"
- Opacity="0" />
- </Border>
- <ContentPresenter
- x:Name="contentPresenter"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
- VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
- Content="{TemplateBinding Header}"
- ContentSource="Header"
- ContentStringFormat="{TemplateBinding HeaderStringFormat}"
- ContentTemplate="{TemplateBinding HeaderTemplate}"
- Focusable="False"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Grid>
- <ControlTemplate.Triggers>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="mainBorder" Property="Background">
- <Setter.Value>
- <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
- <GradientStop Offset="0" Color="#FFECF4FC" />
- <GradientStop Offset="1" Color="#FFDCECFC" />
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="mainBorder" Property="Background">
- <Setter.Value>
- <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
- <GradientStop Offset="0" Color="#FFECF4FC" />
- <GradientStop Offset="1" Color="#FFDCECFC" />
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="mainBorder" Property="Background">
- <Setter.Value>
- <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
- <GradientStop Offset="0" Color="#FFECF4FC" />
- <GradientStop Offset="1" Color="#FFDCECFC" />
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="mainBorder" Property="Background">
- <Setter.Value>
- <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
- <GradientStop Offset="0" Color="#FFECF4FC" />
- <GradientStop Offset="1" Color="#FFDCECFC" />
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,1,0" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,1,0" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
- <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
- <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
- <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
- <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
- <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
- <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
- <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
- <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,1,0" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,1,0" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
- </MultiDataTrigger.Conditions>
- <Setter Property="Panel.ZIndex" Value="1" />
- <Setter Property="Margin" Value="-2,-2,0,-2" />
- <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
- </MultiDataTrigger.Conditions>
- <Setter Property="Panel.ZIndex" Value="1" />
- <Setter Property="Margin" Value="-2,0,-2,-2" />
- <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
- </MultiDataTrigger.Conditions>
- <Setter Property="Panel.ZIndex" Value="1" />
- <Setter Property="Margin" Value="0,-2,-2,-2" />
- <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
- </MultiDataTrigger.Conditions>
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="0" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="0" />
- <Setter TargetName="mainBorder" Property="Background" Value="Transparent" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
- <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
- </MultiDataTrigger.Conditions>
- <Setter Property="Panel.ZIndex" Value="1" />
- <Setter Property="Margin" Value="0" />
- <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
- <Setter TargetName="innerBorder" Property="BorderThickness" Value="0" />
- <Setter TargetName="mainBorder" Property="BorderThickness" Value="0" />
- <Setter TargetName="mainBorder" Property="Background" Value="Transparent" />
- </MultiDataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- <!-- design token TabHeader for Forms Property -->
- <Style x:Key="FormTabControl" TargetType="{x:Type TabControl}">
- <Setter Property="Padding" Value="2" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <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"
- KeyboardNavigation.TabNavigation="Local"
- SnapsToDevicePixels="true">
- <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>
- <Border
- Grid.Row="0"
- Grid.Column="0"
- Background="{StaticResource color.sys.layout.fg.dark}"
- CornerRadius="4">
- <TabPanel
- x:Name="headerPanel"
- Margin="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Panel.ZIndex="1"
- Background="Transparent"
- IsItemsHost="true"
- KeyboardNavigation.TabIndex="1" />
- </Border>
- <Border
- x:Name="contentPanel"
- Grid.Row="1"
- Grid.Column="0"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- KeyboardNavigation.DirectionalNavigation="Contained"
- KeyboardNavigation.TabIndex="2"
- KeyboardNavigation.TabNavigation="Local">
- <ContentPresenter
- x:Name="PART_SelectedContentHost"
- Margin="{TemplateBinding Padding}"
- ContentSource="SelectedContent"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="TabStripPlacement" Value="Bottom">
- <Setter TargetName="headerPanel" Property="Grid.Row" Value="1" />
- <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
- <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
- <Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
- <Setter TargetName="headerPanel" Property="Margin" Value="2,0,2,2" />
- </Trigger>
- <Trigger Property="TabStripPlacement" Value="Left">
- <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
- <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
- <Setter TargetName="headerPanel" Property="Grid.Column" Value="0" />
- <Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
- <Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
- <Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
- <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
- <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
- <Setter TargetName="headerPanel" Property="Margin" Value="2,2,0,2" />
- </Trigger>
- <Trigger Property="TabStripPlacement" Value="Right">
- <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
- <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
- <Setter TargetName="headerPanel" Property="Grid.Column" Value="1" />
- <Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
- <Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
- <Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
- <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
- <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
- <Setter TargetName="headerPanel" Property="Margin" Value="0,2,2,2" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|