我正在尝试将静态类添加为资源Application.Resources
namespace MultiResImageChooser
{
public static class MultiResObjectInstance
{
private static MultiResPropertyChanged multiResObject = new MultiResPropertyChanged();
public static MultiResPropertyChanged current
{
get
{
return multiResObject;
}
}
}
}
然后在 App.xaml 我有
xmlns:static="clr-namespace:MultiResImageChooser"
....
<Application.Resources>
<static:MultiResObjectInstance x:Key="MultiResObjectInstance"/>
</Application.Resources>`
但在设计视图中,VS2012 抱怨说The type MultiResObjectInstance is an abstract and must include an explicit value
如何在 App.xaml 中正确包含静态类作为资源?