Files
2026-02-20 15:31:44 +08:00

145 lines
8.0 KiB
XML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Melskin.Controls"
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations">
<Style x:Key="EmbossChipStyle" TargetType="{x:Type controls:Chip}">
<Setter Property="Background" Value="{DynamicResource PrimaryVariantBrush}" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Foreground" Value="{DynamicResource TextAccentBrush}" />
<Setter Property="HeadBackground" Value="{DynamicResource PrimaryNormalBrush}" />
<Setter Property="HeadForeground" Value="{DynamicResource TextAccentBrush}" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Padding" Value="5,3" />
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:Chip}">
<decorations:EmbossBorder
x:Name="rootBorder"
Margin="-4"
Padding="0"
CornerRadius="3"
ToolTip="{TemplateBinding Url}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Border
x:Name="headBorder"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding HeadBackground}"
CornerRadius="3,0,0,3"
TextBlock.FontWeight="Bold"
TextBlock.Foreground="{TemplateBinding HeadForeground}">
<ContentPresenter
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
ContentSource="Header"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<Border
x:Name="contentBorder"
Grid.Column="1"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
CornerRadius="0,3,3,0"
TextBlock.FontWeight="Bold"
TextBlock.Foreground="{TemplateBinding Foreground}">
<ContentPresenter
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Grid>
</decorations:EmbossBorder>
<ControlTemplate.Triggers>
<Trigger Property="Url" Value="{x:Null}">
<Setter Property="Cursor" Value="Arrow" />
</Trigger>
<Trigger Property="Header" Value="{x:Null}">
<Setter TargetName="contentBorder" Property="CornerRadius" Value="3" />
<Setter TargetName="headBorder" Property="Padding" Value="0" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type controls:Chip}">
<Setter Property="Background" Value="{DynamicResource PrimaryVariantBrush}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Foreground" Value="{DynamicResource TextAccentBrush}" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HeadBackground" Value="{DynamicResource PrimaryNormalBrush}" />
<Setter Property="HeadForeground" Value="{DynamicResource TextAccentBrush}" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Padding" Value="5,3" />
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:Chip}">
<Border
x:Name="rootBorder"
Padding="0"
CornerRadius="3"
ToolTip="{TemplateBinding Url}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Border
x:Name="headBorder"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding HeadBackground}"
CornerRadius="3,0,0,3"
TextBlock.FontWeight="Bold"
TextBlock.Foreground="{TemplateBinding HeadForeground}">
<ContentPresenter
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
ContentSource="Header"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<Border
x:Name="contentBorder"
Grid.Column="1"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
CornerRadius="0,3,3,0"
TextBlock.FontWeight="Bold"
TextBlock.Foreground="{TemplateBinding Foreground}">
<ContentPresenter
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Url" Value="{x:Null}">
<Setter Property="Cursor" Value="Arrow" />
</Trigger>
<Trigger Property="Header" Value="{x:Null}">
<Setter TargetName="contentBorder" Property="CornerRadius" Value="3" />
<Setter TargetName="headBorder" Property="Padding" Value="0" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>