如何在Silverlight中将字符串(以xaml格式)绑定到RichTextBox的xaml属性?
|
我有以下xaml,
<RichTextBox Name=\"RichTextBoxPostContent\" Margin=\"0\" Padding=\"8,8,8,0\" IsReadOnly=\"True\" Foreground=\"{x:Null}\" Xaml=\"{Binding Path=PostContent}\"/>
而PostContent(字符串)将xaml存储为字符串,并且我不确定如何将其绑定到RichTextBox的Xaml属性,以下是PostContent的值,
<Section xml:space=\"preserve\" HasTrailingParagraphBreakOnPaste=\"False\" xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"><Paragraph FontSize=\"11\" FontFamily=\"Portable User Interface\" Foreground=\"#FF000000\" FontWeight=\"Normal\" FontStyle=\"Normal\" FontStretch=\"Normal\" TextAlignment=\"Left\"><Run Text=\"aaa\" /></Paragraph></Section>
没有找到相关结果
已邀请:
2 个回复
丧泉缝锋
在Silverlight中不是依赖项属性,因此您无法绑定到它。您将必须编写预订
的代码,并在更改时执行does4ѭ的代码。
筷啸够对铅
如果要绑定的属性如下所示:
然后您的xaml看起来类似于: