Files
ShrlAlgoToolkit/Wpf.Ui.Extend/Controls/GroupBox/GroupBox.xaml
2024-09-22 11:05:41 +08:00

67 lines
4.1 KiB
XML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:exc="clr-namespace:Wpf.Ui.Extend.Controls"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
<ResourceDictionary.MergedDictionaries>
<!--<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Resources/Variables.xaml" />-->
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Resources/Theme/Dark.xaml" />
<!--<ResourceDictionary Source="pack://application:,,,/Wpf.Ui.Extend;component/Resources/DesignTime.xaml" />-->
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui.Extend;component/Resources/Variables.xaml" />
<!--<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Button/Button.xaml" />-->
</ResourceDictionary.MergedDictionaries>
<Style x:Key="DefaultGroupBoxStyle" TargetType="{x:Type GroupBox}">
<Setter Property="Foreground" Value="{DynamicResource CardForeground}" />
<Setter Property="Background" Value="{DynamicResource CardBackground}" />
<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
x:Name="Header_Border"
Grid.Row="0"
Padding="{TemplateBinding Padding}"
Background="{DynamicResource CardFooterBackground}"
CornerRadius="{DynamicResource ControlTopCornerRadius}">
<ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
ContentSource="Header"
ContentStringFormat="{TemplateBinding HeaderStringFormat}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ContentPresenter
Grid.Row="1"
Margin="{TemplateBinding Padding}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style
x:Key="{x:Type GroupBox}"
BasedOn="{StaticResource DefaultGroupBoxStyle}"
TargetType="{x:Type GroupBox}" />
</ResourceDictionary>