'System.Windows.StaticResourceExtension' threw an exception
As a work around for this issue I moved all styles defined in App.xaml to another Resource dictionary file (say GenericThemes.xaml ) , and included that resource dictionary in app.xaml as below
<Application.Resources>
<ResourceDictionary Source="GenericThemes.xaml" />
</Application.Resources>
The styles defined in GenericThemes.xaml are now available across the application without any extra changes and without this exception.
在Resources/Icon.xaml 定义资源字典,则在app.xaml添加
<Application.Resources>
<ResourceDictionary Source="Resources/Icon.xaml" />
</Application.Resources>
作者:王春明
出处:http://wangchunming.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。