FlowDocument 动态加载并显示Xaml
http://blog.youkuaiyun.com/abrahamcheng/article/details/7061801
Byte[] bytes = Encoding.UTF8.GetBytes(xamlString);
MemoryStream memoryStream = new MemoryStream(bytes);
XmlTextReader xmlTextReader = new XmlTextReader(memoryStream);
objectXaml = XamlReader.Load(xmlTextReader);
if (objectXaml is FlowDocument)
{
FlowDocument flowDocument = objectXaml as FlowDocument;
richTextBox.Document = flowDocument;
}
本文介绍如何将Xaml字符串动态转换为FlowDocument,并在RichTextBox中展示。通过使用XamlReader.Load方法从内存流中读取Xaml内容,实现跨平台的富文本编辑功能。
1474

被折叠的 条评论
为什么被折叠?



