当我试图在xaml中绘制一个矩形时,我得到了以下神秘的运行时错误:
'System.Windows.Markup.XamlParseException' in PresentationFramework.dll
Additional information: 'Provide value on 'System.Windows.Baml2006.DeferredBinaryDeserializerExtension' threw an exception.' Line number '364' and line position '18'.代码片段是:
<Rectangle Fill="MyGreenBrush"
Width="10"
Height="10"/>更新:在一些资源部分:
<SolidColorBrush x:Key="MyGreenBrush" Color="Green"/>发布于 2016-05-18 17:32:21
原因是我忘了使用StaticResource。正确的代码片段是:
<Rectangle Fill="{StaticResource MyGreenBrush}"
Width="10"
Height="10"/>https://stackoverflow.com/questions/37295514
复制相似问题