2 changed files with 102 additions and 19 deletions
@ -1,23 +1,100 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui"> |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<TabStripItem>Leaf</TabStripItem> |
|||
<TabStripItem IsSelected="True">Arch</TabStripItem> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<Styles.Resources> |
|||
<x:Double x:Key="TabStripItemHeight">48</x:Double> |
|||
</Styles.Resources> |
|||
|
|||
<Style Selector="TabStripItem"> |
|||
<Setter Property="Background" Value="Transparent"/> |
|||
<Setter Property="FontSize" Value="{DynamicResource FontSizeLarge}"/> |
|||
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundLowBrush}"/> |
|||
<Setter Property="FontSize" Value="{DynamicResource PivotHeaderItemFontSize}" /> |
|||
<Setter Property="FontWeight" Value="{DynamicResource PivotHeaderItemThemeFontWeight}" /> |
|||
<Setter Property="Background" Value="{DynamicResource PivotHeaderItemBackgroundUnselected}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource PivotHeaderItemForegroundUnselected}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource PivotHeaderItemMargin}" /> |
|||
<Setter Property="Margin" Value="0" /> |
|||
<Setter Property="Height" Value="{DynamicResource TabStripItemHeight}" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Padding="{TemplateBinding Padding}"/> |
|||
<Border Name="PART_LayoutRoot" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<Panel> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
TextBlock.FontFamily="{TemplateBinding FontFamily}" |
|||
TextBlock.FontSize="{TemplateBinding FontSize}" |
|||
TextBlock.FontWeight="{TemplateBinding FontWeight}" /> |
|||
<Border Name="PART_SelectedPipe" |
|||
Height="2" |
|||
Margin="0,0,0,2" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Bottom" |
|||
CornerRadius="{DynamicResource ControlCornerRadius}" |
|||
Background="{DynamicResource PivotHeaderItemSelectedPipeFill}" /> |
|||
</Panel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
|
|||
<!-- Nornal state --> |
|||
<Style Selector="TabStripItem /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{Binding $parent[TabStripItem].Background}" /> |
|||
</Style> |
|||
<Style Selector="TabStripItem /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<!-- Selected state --> |
|||
<!-- We don't use selector to PART_LayoutRoot, so developer can override selected item background with TabStripItem.Background --> |
|||
<Style Selector="TabStripItem:selected"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}"/> |
|||
<Setter Property="Background" Value="{DynamicResource PivotHeaderItemBackgroundSelected}" /> |
|||
<Setter Property="TextBlock.Foreground" Value="{DynamicResource PivotHeaderItemForegroundSelected}" /> |
|||
</Style> |
|||
<Style Selector="TabStripItem:selected /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<!-- PointerOver state --> |
|||
<Style Selector="TabStripItem:pointerover /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource PivotHeaderItemBackgroundUnselectedPointerOver}" /> |
|||
<Setter Property="TextBlock.Foreground" Value="{DynamicResource PivotHeaderItemForegroundUnselectedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected PointerOver state --> |
|||
<Style Selector="TabStripItem:selected:pointerover /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource PivotHeaderItemBackgroundSelectedPointerOver}" /> |
|||
<Setter Property="TextBlock.Foreground" Value="{DynamicResource PivotHeaderItemForegroundSelectedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed state --> |
|||
<Style Selector="TabStripItem:pressed /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource PivotHeaderItemBackgroundUnselectedPressed}" /> |
|||
<Setter Property="TextBlock.Foreground" Value="{DynamicResource PivotHeaderItemForegroundUnselectedPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected Pressed state --> |
|||
<Style Selector="TabStripItem:pressed /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource PivotHeaderItemBackgroundSelectedPressed}" /> |
|||
<Setter Property="TextBlock.Foreground" Value="{DynamicResource PivotHeaderItemForegroundSelectedPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled state --> |
|||
<Style Selector="TabStripItem:disabled /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource PivotHeaderItemBackgroundDisabled}" /> |
|||
<Setter Property="TextBlock.Foreground" Value="{DynamicResource PivotHeaderItemForegroundDisabled}" /> |
|||
</Style> |
|||
</Styles> |
|||
</Styles> |
|||
|
|||
Loading…
Reference in new issue