MVVM (Model View View Model) - DevOli/Marvel-chars GitHub Wiki

The separation of the code in MVVM is divided into View, ViewModel and Model:

View is the collection of visible elements, which also receives user input. As in the model–view–controller (MVC) and model–view–presenter (MVP) patterns, the view is the structure, layout, and appearance of what a user sees on the screen. It displays a representation of the model and receives the user's interaction with the view (mouse clicks, keyboard input, screen tap gestures, etc.), and it forwards the handling of these to the view model via the data binding (properties, event callbacks, etc.) that is defined to link the view and view model.

ViewModel is located between the View and Model layers. This is where the controls for interacting with View are housed, while binding is used to connect the UI elements in View to the controls in ViewModel.

Model houses the logic for the program, which is retrieved by the ViewModel upon its own receipt of input from the user through View.

See examples

model example