Closed Tum4ik closed 5 years ago
Headings use styles. So you need to update/override those.
See https://github.com/Kryptos-FR/markdig.wpf/blob/develop/src/Markdig.Wpf/Themes/generic.xaml
Yep, that's it. Thanks!
Should this style really override the Foreground
color?
<Style TargetType="{x:Type Paragraph}" x:Key="{x:Static markdig:Styles.Heading1StyleKey}">
<Setter Property="FontSize" Value="42" />
<Setter Property="Foreground" Value="#ff000000" />
<Setter Property="FontWeight" Value="Bold" />
</Style>
Why not use the default Foreground
value?
Can you advise on how to override this style? I've got the following error when trying:
<Style TargetType="{x:Type markdig:Styles.Heading1StyleKey}">
...
</Style>
Nested types are not supported: Styles.Heading1StyleKey.
@Otiel , I've created a separate resource dictionary file and define the style there like:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:markdig="clr-namespace:Markdig.Wpf;assembly=Markdig.Wpf">
...
<Style TargetType="{x:Type Paragraph}" x:Key="{x:Static markdig:Styles.Heading2StyleKey}">
<Setter Property="FontSize" Value="20" />
<Setter Property="Foreground" Value="#FF007ACC" />
<Setter Property="FontWeight" Value="Bold" />
</Style>
...
</ResourceDictionary>
Thanks, exactly what I needed!
License.md