开发者

Inherit from an abstract class and realize an interface at the same time

I have C# class definition

MyViewModelClass: INotifyPropertyChanged, MyAbs开发者_开发百科tractBaseForVMClass

It won't compile. Gives and error at the start of MyAbstractBaseForVMClass literal:

Interface definition is expected.

Can I not realize an interface, and inherit from an abstract class at the same time?


No you can. Just reverse them.

MyViewModelClass: MyAbstractBaseForVMClass, INotifyPropertyChanged

Interfaces always come after classes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜