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

57 lines
2.4 KiB
Plaintext
Raw Normal View History

2025-10-10 11:19:58 +08:00
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- 水平分割 -->
2025-12-23 21:35:54 +08:00
<Style x:Key="HorizontalSeparatorStyle" TargetType="{x:Type Separator}">
2025-10-10 11:19:58 +08:00
<Setter Property="Background" Value="{DynamicResource BorderNormalBrush}" />
<Setter Property="Margin" Value="0,4" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Border
2025-12-23 21:35:54 +08:00
Height="1"
2025-10-10 11:19:58 +08:00
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="true" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 默认水平分割 -->
<Style BasedOn="{StaticResource HorizontalSeparatorStyle}" TargetType="{x:Type Separator}" />
<!-- 菜单分隔 -->
<Style
2025-12-23 21:35:54 +08:00
x:Key="{x:Static MenuItem.SeparatorStyleKey}"
2025-10-10 11:19:58 +08:00
BasedOn="{StaticResource HorizontalSeparatorStyle}"
2025-12-23 21:35:54 +08:00
TargetType="{x:Type Separator}">
2025-10-10 11:19:58 +08:00
<Setter Property="Margin" Value="0,2" />
</Style>
<!-- 垂直分割 -->
2025-12-23 21:35:54 +08:00
<Style x:Key="VerticalSeparatorStyle" TargetType="{x:Type Separator}">
2025-10-10 11:19:58 +08:00
<Setter Property="Background" Value="{DynamicResource BorderNormalBrush}" />
<Setter Property="Margin" Value="2,0" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Border
2025-12-23 21:35:54 +08:00
Width="1"
2025-10-10 11:19:58 +08:00
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
2025-12-23 21:35:54 +08:00
SnapsToDevicePixels="true" />
2025-10-10 11:19:58 +08:00
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 状态栏分割 -->
<Style
2025-12-23 21:35:54 +08:00
x:Key="{x:Static StatusBar.SeparatorStyleKey}"
2025-10-10 11:19:58 +08:00
BasedOn="{StaticResource VerticalSeparatorStyle}"
2025-12-23 21:35:54 +08:00
TargetType="{x:Type Separator}">
2025-10-10 11:19:58 +08:00
<Setter Property="Margin" Value="4,2" />
</Style>
</ResourceDictionary>