Saber Amani
Saber Amani

Reputation: 6489

XAML to Html and vice versa

I'm currently working on a SilverLight text editor for my site control panel, I almost done with that, but now I need to convert XAML to Html and vice versa (as you probably know Silverlight's RichTextBox returns XAML) So I've to convert it to Html. Any idea how can I handle this ?

Upvotes: 5

Views: 26704

Answers (3)

Sean Kearon
Sean Kearon

Reputation: 11427

This product converts C# and XAML to HTML and JavaScript. It has a free edition that allows commercial use.

http://cshtml5.com/

A wide range of both .NET and XAML features are supported, which can be seen here.

Upvotes: 4

Saber Amani
Saber Amani

Reputation: 6489

This tool allows you to enter XAML and have it converted to HTML, or enter HTML and have it converted to XAML.

XAML to HTML and HTML to XAML Converter

Upvotes: 2

Joey
Joey

Reputation: 354406

Well, it's just XML. So convert Section and Paragraph elements to their appropriate HTML equivalents (p and div, probably) and do so for the inlines as well (Run expands to just the text, probably, Span gets span, LineBreak gets br, etc.).

I.e. what you need to do is read the XAML as XML and create another document alongside where you write the elements as HTML. Applying formatting is a bit tricky, though, as you need to convert that to CSS styles (and maybe not everything apart from basic font properties works the same way in XAML and CSS).

Upvotes: 3

Related Questions