I have the following XAML which displays correctly:
<GroupBox Name="RulesGroupBox" Header="Rules">
<StackPanel Name="RulesStackPanel"
HorizontalAlignment="Left">
....
</StackPanel>
</GroupBox>
I now want to make the header text bold using the following (which I know works in other projects):
<GroupBox Name="RulesGroupBox">
<GroupBox.Header>
<TextBlock FontWeight="Bold" Text="Rules"></TextBlock>
</GroupBox.Header>
<StackPanel Name="RulesStackPanel"
HorizontalAlignment="Left">
....
</StackPanel>
</GroupBox>
For some reason, in this project, this change has the effect of making the text displayed for the Header text "System.Windows.Controls.TextBlock" and not "Rules". The text is now bold but not displaying "Rules".
Any idea why the chagne would not show "Rules" in bold?
You likely have changed GroupBox's HeaderTemplate and this template supports displaying only text.
Header is defined more than once.
<GroupBox Name="RulesGroupBox">
<GroupBox.Header>
<TextBlock FontWeight="Bold" Text="Rules"></TextBlock>
</GroupBox.Header>
<StackPanel Name="RulesStackPanel"
HorizontalAlignment="Left">
....
</StackPanel>
</GroupBox>
"Rules" appears in bold with this correction.
Edit : This answer was made for the question before it has been edited. It's clearly not the good answer for the edited question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With