ux: style for column header of DataGrid

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-07-24 20:56:38 +08:00
parent a603f376ca
commit 70be81f650

View File

@@ -54,16 +54,14 @@
<DataGrid.Styles>
<Style Selector="DataGridColumnHeader">
<Setter Property="MinHeight" Value="24"/>
<Setter Property="Background" Value="{DynamicResource Brush.Window}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Background" Value="{DynamicResource Brush.Window}"/>
<Setter Property="Template">
<ControlTemplate>
<Border x:Name="HeaderBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid ColumnDefinitions="*,Auto">
BorderThickness="0"
CornerRadius="0">
<Grid ColumnDefinitions="*,4">
<ContentPresenter x:Name="PART_ContentPresenter"
Grid.Column="0"
Content="{TemplateBinding Content}"
@@ -71,8 +69,8 @@
<Rectangle Name="VerticalSeparator"
Grid.Column="1"
Width="1.1"
VerticalAlignment="Stretch"
Width="1"
HorizontalAlignment="Center" VerticalAlignment="Stretch"
Fill="{DynamicResource Brush.Border0}"
IsVisible="{TemplateBinding AreSeparatorsVisible}" />
</Grid>