How to use style for GroupBox header?

Did you try the following?

<Style TargetType="GroupBox">
    <Setter Property="BorderBrush" Value="{StaticResource lightBlueBrush}"/>
    <Setter Property="Margin" Value="25,1,5,5"/>
    <Setter Property="HeaderTemplate">
        <Setter.Value>
            <DataTemplate>
                <TextBlock Text="{Binding}" FontWeight="Bold"/>
            </DataTemplate>
        </Setter.Value>
    </Setter>
</Style>

Usage:

<GroupBox Header="Title" />

Leave a Comment