Files
ShrlAlgoToolkit/NeoUI/NeoUI/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
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
Grid.RowSpan="2" />
<!-- 头部 -->
<Border
Background="{TemplateBinding BorderBrush}"
CornerRadius="4,4,0,0"
Grid.Row="0"
x:Name="Header">
<ContentPresenter
ContentSource="Header"
Margin="8"
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>