I created a custom header for my GroupBox like the following image:
I want also to set a Binding on the Backgroud of this header, so I wrote the following code:
<GroupBox Width="130"
Height="80"
BorderBrush="Black"
Margin="5"
Grid.Row="0"
Background="{Binding HColor}">
<GroupBox.HeaderTemplate>
<DataTemplate>
<Border BorderBrush="Black"
BorderThickness="1"
CornerRadius="3"
HorizontalAlignment="Stretch"
Width="70"
Margin="-2,0,-3,-1"
Height="20"
Background="{Binding HColor}">
<TextBlock Text="Hubs"
Foreground="Black"
FontWeight="DemiBold"
HorizontalAlignment="Center" />
</Border>
</DataTemplate>
</GroupBox.HeaderTemplate>
</GroupBox>
After execution, I the GroupBox's Background is colord in the right way, but not the header !
Is anyone able to explain to me why it's not working well ?