I have the following interfaces:
Interface IViewModel
...
End Interface
Interface ISpecialViewModel
Inherits IViewModel
...
End Interface
Interface IView
WriteOnly Property MyViewModel As IViewModel
End Interface
Following are my classes:
Class VerySpecialViewModel
implements ISpecialViewModel
...
End Class
Class View
Implements IView
Public WriteOnly Property MyViewModel As VerySpecialViewModel Implements IView.MyViewModel
...
End Property
End Class
It tells me that 'MyViewModel' cannot implement 'MyViewModel' because there is no matching property on interface 'IView'.
That interface declaration isn't satisfied by your class implementation. Consider following situation:
There is another interface called IChild2:
According to
ISomething
interface you should be able to assign instance of class implementingIChild2
intoThing.Prop
, because it inheritsIParent
.But you can't, becauseThing.Prop
property is ofIChild
type andIChild2
does not inheritsIChild
Update
What about that solution:
Update2
or