wd:MarkdownViewer¶
Category: Other Controls · Available in the WPFDevelopers NuGet package.
Renders Markdown as rich text in WPF, useful for guides, README content, and logs.
Example Source¶
Detailed Usage¶
wd:MarkdownViewer renders Markdown content as rich text in WPF, which is ideal for README files, help documentation, changelogs, and in-app knowledge content. It supports common Markdown elements such as headings, lists, blockquotes, code blocks, tables, links, and images.
The most commonly used property is Markdown, which accepts the Markdown text directly:
<Grid>
<wd:MarkdownViewer
Margin="12"
Padding="12"
FontSize="14"
Markdown="## Hello Markdown This is **WPFDevelopers** MarkdownViewer." />
</Grid>
You can also bind the content dynamically:
<wd:MarkdownViewer
Margin="12"
Padding="12"
Markdown="{Binding MarkdownText}" />
public string MarkdownText { get; } = "# WPFDevelopers\n\n- Supports headings\n- Supports lists\n- Supports code blocks";
Common usage notes:
Markdown: the Markdown text to renderPadding: spacing inside the content areaFontSize,FontFamily,Foreground: text style customization
The complete sample and interactive demo are available here:
src/WPFDevelopers.Samples.Shared/ExampleViews/MarkdownViewerExample.xamlsrc/WPFDevelopers.Samples.Shared/ExampleViews/MarkdownViewerExample.xaml.cs