Lightweight WPF Markdown viewer control for .NET 10.
MdViewer is a small WPF UserControl that converts Markdown to HTML (via Markdig) and displays it using the built-in WebBrowser control.
- Render Markdown to styled HTML
- Simple
Contentproperty to set Markdown text - External
http/httpslinks open in the default browser - Temporary HTML is removed when the control is disposed
Tip
You can view a sample app in tests/MdViewer.SampleApp.
Steps to add MdViewer to your project:
-
Add the namespace reference:
xmlns:md="clr-namespace:MdViewer;assembly=MdViewer"
-
Insert the control where you want to display Markdown (suggested
FontSize: 16):<md:Markdown x:Name="MdViewer" FontSize="16" />
You can also set
FontFamily. -
Load Markdown by setting the
Contentproperty:MdViewer.Content = "# Hello, Markdown!";
-
Call
Dispose()when the window is closed to clean up the temporary file:protected override void OnClosed(EventArgs e) { base.OnClosed(e); MdViewer.Dispose(); }
- Uses
Markdigfor conversion (https://github.com/xoofx/markdig) - Licensed under Apache License 2.0

