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()
{
}
}
}