Files
ShrlAlgoToolkit/Melskin/Controls/GroupBox.xaml

50 lines
2.5 KiB
Plaintext
Raw Normal View History

2025-08-12 23:08:54 +08:00
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2025-07-11 09:20:23 +08:00
<Style TargetType="{x:Type GroupBox}">
2025-08-12 23:08:54 +08:00
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
2025-08-26 21:33:20 +08:00
<Setter Property="Background" Value="{DynamicResource BackgroundLayoutBrush}" />
2025-08-12 23:08:54 +08:00
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
2025-07-11 09:20:23 +08:00
<Setter Property="Margin" Value="4" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Padding" Value="4" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupBox}">
<Grid SnapsToDevicePixels="true">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" MinHeight="32" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
2025-08-12 23:08:54 +08:00
<!-- 边框与背景 -->
<Border
2025-12-23 21:35:54 +08:00
Grid.RowSpan="2"
2025-08-12 23:08:54 +08:00
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
2025-12-23 21:35:54 +08:00
CornerRadius="4" />
2025-08-12 23:08:54 +08:00
<!-- 头部 -->
<Border
2025-12-23 21:35:54 +08:00
x:Name="Header"
2025-08-12 23:08:54 +08:00
Grid.Row="0"
2025-12-23 21:35:54 +08:00
Background="{TemplateBinding BorderBrush}"
CornerRadius="4,4,0,0">
2025-08-12 23:08:54 +08:00
<ContentPresenter
Margin="8"
2025-12-23 21:35:54 +08:00
ContentSource="Header"
2025-08-12 23:08:54 +08:00
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
2025-09-04 22:39:00 +08:00
TextElement.Foreground="{DynamicResource TextPrimaryBrush}" />
2025-07-11 09:20:23 +08:00
</Border>
2025-08-12 23:08:54 +08:00
<!-- 内容 -->
<ContentPresenter
Grid.Row="1"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
2025-07-11 09:20:23 +08:00
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>