Is there an easy way to change header font size without overwriting completely duplicating ColumnHeaderTemplate?
Note: Not sure if it is relevant, but I use an application theme (PresentationFramework.Royale) which provides the ColumnHeaderTemplate.
If you aren't also applying a style to the Column Headers, you could use that. And even if you are, by setting the BasedOn property on the style you can maintain everything but what you want to change.
<ListView>
<ListView.View>
<GridView>
<GridView.ColumnHeaderContainerStyle>
<Style>
<Setter Property="TextElement.FontSize"
Value="32" />
</Style>
</GridView.ColumnHeaderContainerStyle>
<GridViewColumn Header="Stuff"/>
<GridViewColumn Header="More Stuff" />
</GridView>
</ListView.View>
</ListView>
Edit:
I Haven't used the built in themes before, so I tested this out. The PresentationFramework.Royale theme isn't actually applying a template to the column headers. It is applying a Style which uses a setter to apply the ControlTemplate like recommended.
So, in order to keep the Royale theme on the Column Headers we do need to use the BasedOn property of the Style we created. Here's the updated Style deffinition that will both allow you to modify what you like, and retain the Royale Theme:
<Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
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