1
我有了閱讀FlowDocument
到內存中下面的代碼,但每當我試圖解析它,我得到XamlParseException
,出現以下錯誤:FlowDocument的分析錯誤與文檔主體<ed:Arc>
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: 'Cannot create unknown type '{http://schemas.microsoft.com/expression/2010/drawing}Arc'.' Line number '6' and line position '5'.
這裏是我的FD.xaml
文件包含:
FD.xaml
<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
ColumnWidth="400" FontSize="14" FontFamily="Georgia"
xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" >
<Paragraph>
<Canvas Canvas.Top="100" Canvas.Left="402">
<ed:Arc ArcThickness="10" Fill="Black" EndAngle="360" Height="7" Width="11" Margin="0,0,0,0"/>
<ed:Arc ArcThickness="10" Fill="Black" EndAngle="360" Height="7" Width="11" Margin="0,12,0,0"/>
<ed:Arc ArcThickness="10" Fill="Black" EndAngle="360" Height="7" Width="11" Margin="0,24,0,0"/>
<ed:Arc ArcThickness="10" Fill="Black" EndAngle="360" Height="7" Width="11" Margin="368,108,0,0"/>
</Canvas>
</Paragraph>
</FlowDocument>
個MainWindow.xaml.cs
...
String xamlContent = ReadFileContents("FD.xaml");
FlowDocument doc = XamlReader.Parse(xamlContent) as FlowDocument; // Error occurs right here
...
我試過到目前爲止: 新增參考Microsoft.Expression.Drawing
,但我仍然無法得到它的工作。
對我來說 「Microsoft.Expression.Drawing」 固定所有的編譯問題的參考(VS2013) – Allender