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.
精彩评论