2025-07-31 20:12:01 +08:00
|
|
|
|
<ResourceDictionary
|
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2026-01-02 17:30:41 +08:00
|
|
|
|
xmlns:assists="clr-namespace:Melskin.Assists"
|
|
|
|
|
|
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-07-31 20:12:01 +08:00
|
|
|
|
|
|
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
2026-01-02 17:30:41 +08:00
|
|
|
|
<ResourceDictionary Source="/Melskin;component/Themes/Animations.xaml" />
|
|
|
|
|
|
<ResourceDictionary Source="/Melskin;component/Controls/IconElement.xaml" />
|
2025-07-31 20:12:01 +08:00
|
|
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
|
|
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Style TargetType="{x:Type controls:Tag}" x:Key="TagBaseStyle">
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Setter Property="IsTabStop" Value="False" />
|
|
|
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
|
|
|
|
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
|
|
|
<Setter Property="FontSize" Value="12" />
|
|
|
|
|
|
<!--<Setter Property="FontFamily" Value="{DynamicResource FontFamily}" />-->
|
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
|
|
|
|
|
<!--<Setter Property="assists:ControlAssist.BorderStyle" Value="{DynamicResource BorderStyleBase}" />-->
|
|
|
|
|
|
<Setter Property="assists:ControlAssist.CornerRadius" Value="4" />
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Setter Property="RenderTransformOrigin" Value="0,0.5" />
|
|
|
|
|
|
<Setter Property="RenderTransform">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<ScaleTransform />
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Style>
|
|
|
|
|
|
<Style
|
|
|
|
|
|
BasedOn="{StaticResource TagBaseStyle}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
TargetType="{x:Type controls:Tag}"
|
|
|
|
|
|
x:Key="EmbossTag">
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<Setter Property="Padding" Value="8,2" />
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<ControlTemplate TargetType="{x:Type controls:Tag}">
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<decorations:EmbossBorder
|
|
|
|
|
|
CornerRadius="{TemplateBinding assists:ControlAssist.CornerRadius}"
|
|
|
|
|
|
Focusable="False"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
|
Margin="-4"
|
|
|
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
|
x:Name="Effect">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Border
|
2025-07-31 20:12:01 +08:00
|
|
|
|
Background="{TemplateBinding Background}"
|
2025-08-12 23:08:54 +08:00
|
|
|
|
CornerRadius="{TemplateBinding assists:ControlAssist.CornerRadius}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Padding="{TemplateBinding Padding}"
|
2025-07-31 20:12:01 +08:00
|
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
UseLayoutRounding="True"
|
|
|
|
|
|
x:Name="Border">
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<!-- Content -->
|
|
|
|
|
|
<Grid>
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<!-- Content -->
|
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
|
<!-- Close Button -->
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<ColumnDefinition Width="Auto" />
|
2025-07-31 20:12:01 +08:00
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
<ContentPresenter
|
|
|
|
|
|
Content="{TemplateBinding Content}"
|
|
|
|
|
|
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
|
|
|
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
|
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<!-- 关闭图标 为了让触发Close范围足够大而不是只有Path的才能触发,套了一层Border -->
|
2025-09-06 00:36:23 +08:00
|
|
|
|
<Border
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Background="Transparent"
|
2025-07-31 20:12:01 +08:00
|
|
|
|
Grid.Column="1"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
VerticalAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Visibility="Collapsed"
|
|
|
|
|
|
x:Name="PART_Close">
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<controls:IconElement
|
|
|
|
|
|
Foreground="{TemplateBinding Foreground}"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Style="{StaticResource ToolIcon}"
|
2025-09-08 19:49:09 +08:00
|
|
|
|
Symbol="Close"
|
|
|
|
|
|
UseLayoutRounding="True" />
|
2025-09-06 00:36:23 +08:00
|
|
|
|
</Border>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
</Grid>
|
2025-08-12 23:08:54 +08:00
|
|
|
|
</Border>
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</decorations:EmbossBorder>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<Trigger Property="Closable" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Visibility" TargetName="PART_Close" Value="Visible" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
|
<Setter Property="Opacity" Value="0.85" />
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
|
|
<Style BasedOn="{StaticResource TagBaseStyle}" TargetType="{x:Type controls:Tag}">
|
|
|
|
|
|
<Setter Property="Padding" Value="6,4" />
|
|
|
|
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
|
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
|
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<ControlTemplate TargetType="{x:Type controls:Tag}">
|
|
|
|
|
|
<Border
|
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
|
CornerRadius="{TemplateBinding assists:ControlAssist.CornerRadius}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
|
Padding="{TemplateBinding Padding}"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
UseLayoutRounding="True"
|
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
|
x:Name="Border">
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<!-- Content -->
|
|
|
|
|
|
<Grid>
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<!-- Content -->
|
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
|
<!-- Close Button -->
|
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
<ContentPresenter
|
|
|
|
|
|
Content="{TemplateBinding Content}"
|
|
|
|
|
|
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
|
|
|
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
|
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<controls:IconElement
|
|
|
|
|
|
Background="Transparent"
|
|
|
|
|
|
Foreground="{TemplateBinding Foreground}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Column="1"
|
|
|
|
|
|
Padding="1,-4,-4,-4"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Style="{StaticResource ToolIcon}"
|
|
|
|
|
|
Symbol="Close"
|
|
|
|
|
|
UseLayoutRounding="True"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Visibility="Collapsed"
|
|
|
|
|
|
x:Name="PART_Close" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
</Grid>
|
|
|
|
|
|
</Border>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
<ControlTemplate.Triggers>
|
2025-08-20 12:10:13 +08:00
|
|
|
|
<Trigger Property="Closable" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Visibility" TargetName="PART_Close" Value="Visible" />
|
2025-08-20 12:10:13 +08:00
|
|
|
|
</Trigger>
|
2025-07-31 20:12:01 +08:00
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
|
<Setter Property="Opacity" Value="0.85" />
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
|
|
</ResourceDictionary>
|