Files
Shrlalgo.RvKits/Melskin/Controls/Chip.xaml

145 lines
8.0 KiB
Plaintext
Raw Normal View History

2025-08-12 23:08:54 +08:00
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2026-01-02 17:30:41 +08:00
xmlns:controls="clr-namespace:Melskin.Controls"
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations"
2026-01-02 17:30:30 +08:00
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2025-08-12 23:08:54 +08:00
2026-01-02 17:30:30 +08:00
<Style TargetType="{x:Type controls:Chip}" x:Key="EmbossChipStyle">
2025-08-12 23:08:54 +08:00
<Setter Property="Background" Value="{DynamicResource PrimaryVariantBrush}" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Cursor" Value="Hand" />
2025-09-12 09:55:36 +08:00
<Setter Property="Foreground" Value="{DynamicResource TextAccentBrush}" />
<Setter Property="HeadBackground" Value="{DynamicResource PrimaryNormalBrush}" />
2025-09-12 09:55:36 +08:00
<Setter Property="HeadForeground" Value="{DynamicResource TextAccentBrush}" />
2025-12-23 21:35:54 +08:00
<Setter Property="VerticalContentAlignment" Value="Center" />
2025-08-12 23:08:54 +08:00
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Padding" Value="5,3" />
2025-08-26 21:33:20 +08:00
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
2025-08-12 23:08:54 +08:00
<Setter Property="Template">
<Setter.Value>
2025-10-10 11:19:58 +08:00
<ControlTemplate TargetType="{x:Type controls:Chip}">
2025-09-04 22:39:00 +08:00
<decorations:EmbossBorder
2026-01-02 17:30:30 +08:00
CornerRadius="3"
2025-08-20 12:10:35 +08:00
Margin="-4"
Padding="0"
2026-01-02 17:30:30 +08:00
ToolTip="{TemplateBinding Url}"
x:Name="rootBorder">
2025-08-12 23:08:54 +08:00
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Border
Background="{TemplateBinding HeadBackground}"
CornerRadius="3,0,0,3"
2026-01-02 17:30:30 +08:00
Padding="{TemplateBinding Padding}"
2025-08-12 23:08:54 +08:00
TextBlock.FontWeight="Bold"
2026-01-02 17:30:30 +08:00
TextBlock.Foreground="{TemplateBinding HeadForeground}"
x:Name="headBorder">
2025-08-12 23:08:54 +08:00
<ContentPresenter
ContentSource="Header"
Focusable="False"
RecognizesAccessKey="True"
2026-01-02 17:30:30 +08:00
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
2025-08-12 23:08:54 +08:00
</Border>
<Border
Background="{TemplateBinding Background}"
CornerRadius="0,3,3,0"
2026-01-02 17:30:30 +08:00
Grid.Column="1"
Padding="{TemplateBinding Padding}"
2025-12-23 21:35:54 +08:00
TextBlock.FontWeight="Bold"
2026-01-02 17:30:30 +08:00
TextBlock.Foreground="{TemplateBinding Foreground}"
x:Name="contentBorder">
2025-12-23 21:35:54 +08:00
<ContentPresenter
Focusable="False"
RecognizesAccessKey="True"
2026-01-02 17:30:30 +08:00
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
2025-12-23 21:35:54 +08:00
</Border>
</Grid>
</decorations:EmbossBorder>
<ControlTemplate.Triggers>
<Trigger Property="Url" Value="{x:Null}">
<Setter Property="Cursor" Value="Arrow" />
</Trigger>
<Trigger Property="Header" Value="{x:Null}">
2026-01-02 17:30:30 +08:00
<Setter Property="CornerRadius" TargetName="contentBorder" Value="3" />
<Setter Property="Padding" TargetName="headBorder" Value="0" />
2025-12-23 21:35:54 +08:00
</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
CornerRadius="3"
2026-01-02 17:30:30 +08:00
Padding="0"
ToolTip="{TemplateBinding Url}"
x:Name="rootBorder">
2025-12-23 21:35:54 +08:00
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Border
Background="{TemplateBinding HeadBackground}"
CornerRadius="3,0,0,3"
2026-01-02 17:30:30 +08:00
Padding="{TemplateBinding Padding}"
2025-12-23 21:35:54 +08:00
TextBlock.FontWeight="Bold"
2026-01-02 17:30:30 +08:00
TextBlock.Foreground="{TemplateBinding HeadForeground}"
x:Name="headBorder">
2025-12-23 21:35:54 +08:00
<ContentPresenter
ContentSource="Header"
Focusable="False"
RecognizesAccessKey="True"
2026-01-02 17:30:30 +08:00
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
2025-12-23 21:35:54 +08:00
</Border>
<Border
Background="{TemplateBinding Background}"
CornerRadius="0,3,3,0"
2026-01-02 17:30:30 +08:00
Grid.Column="1"
Padding="{TemplateBinding Padding}"
2025-08-12 23:08:54 +08:00
TextBlock.FontWeight="Bold"
2026-01-02 17:30:30 +08:00
TextBlock.Foreground="{TemplateBinding Foreground}"
x:Name="contentBorder">
2025-08-12 23:08:54 +08:00
<ContentPresenter
Focusable="False"
RecognizesAccessKey="True"
2026-01-02 17:30:30 +08:00
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
2025-08-12 23:08:54 +08:00
</Border>
</Grid>
2025-12-23 21:35:54 +08:00
</Border>
2025-08-12 23:08:54 +08:00
<ControlTemplate.Triggers>
<Trigger Property="Url" Value="{x:Null}">
<Setter Property="Cursor" Value="Arrow" />
</Trigger>
<Trigger Property="Header" Value="{x:Null}">
2026-01-02 17:30:30 +08:00
<Setter Property="CornerRadius" TargetName="contentBorder" Value="3" />
<Setter Property="Padding" TargetName="headBorder" Value="0" />
2025-08-12 23:08:54 +08:00
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>