Files
ShrlAlgoToolkit/WPFluent/Controls/GroupBox/GroupBox.xaml

59 lines
3.6 KiB
Plaintext
Raw Normal View History

2025-07-11 09:20:23 +08:00
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2024-09-22 11:05:41 +08:00
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/WPFluent;component/Resources/Variables.xaml" />
2024-09-22 11:05:41 +08:00
</ResourceDictionary.MergedDictionaries>
2025-07-11 09:20:23 +08:00
<Style TargetType="{x:Type GroupBox}" x:Key="DefaultGroupBoxStyle">
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="Background" Value="{DynamicResource CardBackgroundFillColorDefaultBrush}" />
2024-09-22 11:05:41 +08:00
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
<Setter Property="Border.CornerRadius" Value="{DynamicResource TopControlCornerRadius}" />
<Setter Property="Padding" Value="9" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupBox}">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
CornerRadius="{DynamicResource ControlCornerRadius}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border
2025-07-11 09:20:23 +08:00
Background="{DynamicResource CardBackgroundFillColorSecondaryBrush}"
CornerRadius="{DynamicResource ControlTopCornerRadius}"
2024-09-22 11:05:41 +08:00
Grid.Row="0"
Padding="{TemplateBinding Padding}"
2025-07-11 09:20:23 +08:00
x:Name="Header_Border">
2024-09-22 11:05:41 +08:00
<ContentPresenter
ContentSource="Header"
ContentStringFormat="{TemplateBinding HeaderStringFormat}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
2025-07-11 09:20:23 +08:00
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
2024-09-22 11:05:41 +08:00
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ContentPresenter
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
2025-07-11 09:20:23 +08:00
Grid.Row="1"
Margin="{TemplateBinding Padding}"
2024-09-22 11:05:41 +08:00
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style
BasedOn="{StaticResource DefaultGroupBoxStyle}"
2025-07-11 09:20:23 +08:00
TargetType="{x:Type GroupBox}"
x:Key="{x:Type GroupBox}" />
2024-09-22 11:05:41 +08:00
</ResourceDictionary>