I recently needed, for a side project, a way to display styled text - text blocks with word-wrapping, bold, lists and hyperlinks - in a WPF application.

The display text isn’t static, but is going to be generated by code and/or loaded from files, so I needed a solution that was quite flexible in how it worked.

Markdown seemed like a good choice - easy to write and to generate, if only there was a good way to display the formatted results. I found a number of heavyweight solutions but they all seemed like overkill for my simple needs.

My solution? A port of MarkdownSharp that renders to a XAML FlowDocument instead of a string containing HTML.

The resulting code: Markdown.XAML is now available on Github.

Comments

blog comments powered by Disqus
Next Post
Code Analysis vs Code Contracts  16 Feb 2013
Prior Post
Care about the User Experience  21 Jan 2013
Related Posts
Browsers and WSL  31 Mar 2024
Factory methods and functions  05 Mar 2023
Using Constructors  27 Feb 2023
An Inconvenient API  18 Feb 2023
Method Archetypes  11 Sep 2022
A bash puzzle, solved  02 Jul 2022
A bash puzzle  25 Jun 2022
Improve your troubleshooting by aggregating errors  11 Jun 2022
Improve your troubleshooting by wrapping errors  28 May 2022
Keep your promises  14 May 2022
Archives
January 2013
2013