Hi there, I'm new in WP development and I'm trying to understand how the MVVM pattern works.
I also need to understand how it does work with inheritance and custom controls as I want to develop an app that requires them.
So here's a quick sample that I thought, to let you understand what I want to do:
let's say that I'm making an app in which the user can tap on a button and add a custom component to the main grid.
Each custom component has some properties and some of them are common properties between each kind of component.
Coming from Java, I'd just build a base component class and then extend it for each needed component.
This will cause a structure like this:
Now, considered that MVVM requires a model, a view and a view model, this means that my BaseComponent should be divided into
CircleComponent : BaseComponent
SquareComponent : BaseComponent
TriangleComponent : BaseComponent
The question is: how do I work with MVVM and inheritance?
Can I do something like this?
I'm sorry if I can't make the question clearer, but I'm pretty confused about this MVVM thing!
CircleComponentModel : BaseComponentModel
CircleComponentViewModel : BaseComponentViewModel
CircleComponentView : BaseComponentView