views:

196

answers:

2

I would like to get the content of a RichTextBox as a string wich contains the XAML. I seen some post wich show differents solutions with another class for parsing the xaml and transforms it into a stringbuilder. But, my goal is to have the XAML directly generated.

Thanks

A: 

At run-time, there are objects like Paragraph, Run, etc. There is no XAML.

You could serialize the Blocks property, but this will not give you real XAML.

You are forced to analyze the contents and generate the XAML on the fly.

Timores
OK.Thanks. I suposed that it was the only solution for the moment.Maybe in silverlight 5 a way of resolve this kind of problem...
gtoulouse
+1  A: 

The RC version, increase the RichTextBox like :

string richText = MyRichContent.Xaml;
gtoulouse