XamlReader.Parse异常

时间:2015-01-30 13:44:44

标签: c# xaml parsing underline

解析xaml字符串时遇到问题

(FlowDocument)(System.Windows.Markup.XamlReader.Parse(string));

得到了这个例外

'Cannot create unknown type '{http://schemas.microsoft.com/winfx/2006/xaml/presentation}UnderLine'.' Line number '3' and line position '13'.

字符串看起来像这样

<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><Paragraph><Bold>text</Bold></Paragraph>
<Paragraph><Italic>text</Italic></Paragraph>
<Paragraph><UnderLine>text</UnderLine></Paragraph>
...
</FlowDocument>

除了下划线以外的所有其他内容。谁知道问题出在哪里?

1 个答案:

答案 0 :(得分:1)

修正为UnderLine - &gt; Underline