Silverlight 4 RichTextBox - can't restore Xaml with text containing curly braces

Posted by fuzzyman on Stack Overflow See other posts from Stack Overflow or by fuzzyman
Published on 2010-06-08T17:39:04Z Indexed on 2010/06/08 17:43 UTC
Read the original article Hit count: 541

Filed under:
|
|
|

We have a Silverlight application using the RichTextBox as a rich text editor for the user to create emails.

We actually have our own serializer but essentially we are saving and restoring the Xaml. As far as I can tell it is impossible to restore any text containing curly braces.

You can demonstrate this fairly easily by creating a RichTextBox and typing something similar to "{weird}" into it. Then take the .Xaml property of the textbox and set it on the .Xaml property of another textbox - kablooie.

As we have our own serializer I have tried escaping the Text member of the Run elements with "". This makes no difference. I've tried replacing the braces with { but that doesn't work either.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about xaml