0
我有一个从泛型类D派生的类C.我引用XAML文件中的类C。当我构建应用程序,我得到以下错误:引用XAML中的泛型类
标签“C”不存在XML命名空间存在“CLR的命名空间:AB”
我不明白这是由于到C是从泛型类派生的。如果我删除基类,它不会给我任何错误。
我该如何摆脱错误? IInterfaceForE是通过Unity注入的,所以该应用程序工作正常。但我无法摆脱构建错误。
代码片段:
namespace A.B
{
public class C : D<InterfaceForE>
{
public C()
{
}
}
}
// Reference in XAML
xmlns:myns="clr-namespace:A.B"
<myns:C x:Key="KeyForC"/>
// Code snippet after commenting out the base class.
// When I build with this code, there is no build error, but the app wont run.
namespace A.B
{
public class C //: D<InterfaceForE>
{
public C()
{
}
}
}