递延参考 [英] DeferredReference
问题描述
我正在获取此信息:
WindowsBase.dll中发生了类型'System.InvalidCastException'的第一次机会异常
WindowsBase.dll中发生了类型'System.InvalidCastException'的未处理异常
其他信息:无法将类型为"System.Windows.Media.SolidColorBrush"的对象转换为类型为"System.Windows.DeferredReference".
当更改资源字典以在外观之间切换时,程序崩溃但是下一次看起来很好并且可以正常工作(皮肤实际上已改变).
我在这里还看到了另一篇文章:
http://forums.microsoft.com/MSDN/ShowPost.aspx?siteid=1&PostID=3939145
所以也许是个错误吗?不确定.
有什么解决方案或解决方法吗?
谢谢
David
DCProven
I am getting this:
A first chance exception of type 'System.InvalidCastException' occurred in WindowsBase.dll
An unhandled exception of type 'System.InvalidCastException' occurred in WindowsBase.dll
Additional information: Unable to cast object of type 'System.Windows.Media.SolidColorBrush' to type 'System.Windows.DeferredReference'.
When changing resource dictionaries to switch between skins, the program crashes but next time it looks fine and works OK (the skin actually changed).
I've seen this other post here:
http://forums.microsoft.com/MSDN/ShowPost.aspx?siteid=1&PostID=3939145
So maybe it is a bug? not sure.
Any solutions or workaround?
Thanks
David
DCProven
推荐答案
目前,我只是要求用户退出应用程序以使新外观生效.皮肤第一次运行良好,这是第二次崩溃.
我讨厌这种解决方案,但到目前为止我找不到其他方法.
没有其他想法吗?
>
谢谢.
David
For now,
I am just asking the user to exit the application in order for the new skin to take effect. The skin works perfectly the first time, it's the second time that crashes.
I hate this solution, but I can't find any other way so far.
No other ideas?
Thanks.
David
这篇关于递延参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!