Project Description
HTML2XAML is a utility class which converts a HTML string to XAML for display in the RichTextBox. HTML2XAML makes it easier for Silverlight developers to display HTML in a Silverlight RichTextBox.

The project is based on some initial requirements I received for another project. The initial release is simple but it works. It simply takes some html controls and converts them to Xaml then displays them in a RichTextBox.

Thanks to the HTMLAgility pack for the HTML tag parser.

The InlineUIContainer is used to display the list and other formatted data. I am working on customizations which will allow a more configurable tool.
i.e. tab size, font size...

Please Note: The inline UI container's xaml is NOT availble if your pull the xaml of the RTB. Thus it makes debugging issues harder to solve.
example usage

XamlBuilder xamlBldr = new XamlBuilder();
xamlBldr.BuildXaml(tbHtml.Text, rtbname, true);
xamlBldr = null;

There are other items that I am currently completing.
  • the ability to handle full UI layouts (not so easy)
  • the ability to display a table...DONE...note all parameters are parsed but the html table is converted to a GRID

All contributions are welcomed.

Last edited Aug 31, 2010 at 4:50 PM by jldoubleu, version 16