Files
Shrlalgo.RvKits/NeuWPF/NeoUI/Controls/SeparatorStyle.xaml
2025-08-20 12:10:13 +08:00

51 lines
2.4 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--水平分割-->
<Style x:Key="HorizontalSeparator" TargetType="{x:Type Separator}">
<Setter Property="Background" Value="{DynamicResource BorderSubtleBrush}" />
<Setter Property="Margin" Value="0,4" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Height="1" SnapsToDevicePixels="true" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--默认水平分割-->
<Style TargetType="{x:Type Separator}" BasedOn="{StaticResource HorizontalSeparator}"/>
<!--菜单分隔-->
<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="{x:Type Separator}"
BasedOn="{StaticResource HorizontalSeparator}">
<Setter Property="Background" Value="{DynamicResource BorderSubtleBrush}" />
<Setter Property="Margin" Value="0,2" />
</Style>
<!--垂直分割-->
<Style x:Key="VerticalSeparator" TargetType="{x:Type Separator}">
<Setter Property="Background" Value="{DynamicResource BorderSubtleBrush}" />
<Setter Property="Margin" Value="2,0" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Width="1" SnapsToDevicePixels="true" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--状态栏分割-->
<Style x:Key="{x:Static StatusBar.SeparatorStyleKey}" TargetType="{x:Type Separator}"
BasedOn="{StaticResource VerticalSeparator}">
<Setter Property="Margin" Value="4,2"/>
</Style>
</ResourceDictionary>