This mvvm
structure is helpful for extracting the ui model from your application when there are a lot of modules in your code project, then you can have distinct view
and model
not the mix of them, remember it is only a methodology and not suitable for every situation.
View stands for the ui interface, such as
- Menu
- Dialog
- Painting
Model stands for the ui model, such as
- Menu Model
- Dialog Model
- Painting Model
ViewModel has some functionalities, like
-
init Model when app starts
-
init View with property
-
bind func to connect Model and View