Because WPF XAML is a superset of HTML features, almost all you need to do is map one to the other.
If your input is XHTML, you can simply use XSLT or LINQ-to-XML to get the data.
If you use XSLT, you will get XAML, which you parse with XamlReader.Parse () to get a UIElement that you can add to your window or other WPF container. This is probably more than using LINQ-to-XML, because XSLT is relatively limited.
If you use LINQ-to-XML, you can select XAML and then parse it, as with XSLT, or simply create an object tree directly. If you are creating XAML using LINQ-to-XML, I would write the translation code in VB.NET instead of C #, which is my usual preferred language. The VB.NET syntax "XML Literal" simplifies this part of the work.
If your input is arbitrary HTML, not XHTML, I would use a third-party library to convert it to XHTML and work from there. Handling all HTML parsing is a lot of work and probably mostly not related to your actual purpose.
If you just want to render HTML without turning it into WPF objects, you can use the Frame control.
source share