开发者

Strings with formatting in SQL to Silverlight App need help

I am moving all strings in my Silverlight app to the db, but am having some trouble keeping the formatting. Really the only issue is for paragraph sized strings, which in 开发者_JAVA百科the app used to keep the paragraph sized right and spacing between paragraphs. Unfortunately now that I need to bind the textblock I have to use it's text property instead of just sandwiching the text between the opening and closing tags to let the formatting do its thing. The result is that the formatting is displayed as part of the text now and isn't applied. Does anyone know how to get around this? I've tried adding Char(13), \n, different configurations of ' ', it all displays exactly how I enter it. Any ideas?


You need to use a rich text box control. Here are some options for Silverlight: What is the best substitute for FlowDocument in Silverlight?


Silverlight uses \r for line breaks and in SQL Server line breaks are \r\n. There is a nice value converter in this post that converts between the two.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜