top of page

Design Patterns

Public·1 member

MVVM

What is MVVM design pattern?

13 Views
Sunil Dhaul
Sunil Dhaul
Oct 09, 2023
  1. The database logic to save and retrieve data from database is handled by the Model layer of MVVM design pattern. All business logic of the app exists in this layer.

  2. The View layer is just the UI of the application. The UI logic is handled in this layer like button click logic or page load logic or textbox blur logic etc. Sometimes, this layer is just the markup like html or xaml, and the events code is part of ViewModel layer rathern than the View layer.

  3. The ViewModel provides data for the View like providing data for databinding controls and handles data updates from the View. Also, the ViewModel data is representing the current state of the View.

  4. Note that any changes in ViewModel will automatically reflect in View and also any changes in the View will automatically reflect in the ViewModel part. In this sense, data flows/databinding is bi-directional in MVVM.

bottom of page