I'm creating a resources file to be used in our new WPF application. I can create Colour templates as follows:
<SolidColorBrush x:Key="BorderColorBrush" Color="Black"/>
<SolidColorBrush x:Key="NavigationBorderColorBrush" Color="#FF26425D" />
<SolidColorBrush x:Key="ListBorderColorBrush" Color="#FF59593E"/>
but how do i do the same for fonts? ie: a base type font family?
Thanks in advance
If you want to create your own font, I think WPF could not help to you. But if you want all labels and text was in one format, you could use Style for the Control and TextBlock:
<Window.Resources>
<Style TargetType="Control">
<Setter Property="FontFamily" Value="Courier New" />
<Setter Property="Foreground" Value="Red" />
</Style>
<Style TargetType="TextBlock">
<Setter Property="FontFamily" Value="Courier New" />
<Setter Property="Foreground" Value="Red" />
</Style>
</Window.Resources>
Because of TextBlock is not a child class of Control, you should do it twice. (Correct me if its wrong)
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