【发布时间】:2019-07-14 21:51:53
【问题描述】:
我正在研究通用 where 约束,但我遇到了这个并卡住了。我尝试通过我自己的类复制代码,但我得到“不一致的不可访问性”。
//this is the reference study class
public class MainView<T> : System.Windows.Window where T : INotifyPropertyChanged, new(){}
//my own
interface ITest{}
class B : ITest
{
public B()
{
}
}
public class MyClass<T> : B where T : ITest, new()
{
}
我想不通。参考学习班有什么?如何使用自己定义的类和接口进行相同的签名?
【问题讨论】:
-
感谢您指出这一点。我不知道我的问题与访问修饰符有关。