🏗️Model-View-ViewModel (MVVM)
Also known as MVVM, MVVM Pattern, View Model
A way to split screen code into three parts. Data, the view, and a view model.
Think of it like
It is like a scoreboard. When the score changes, the board shows it by itself.
Example
Emma's login screen binds its button to a SignIn command on the view model. She tests that command with no screen at all.
Why it matters
The view model can be tested without a screen. Designers can change the look without touching the logic.
Definition
Common mistake
Key takeaways
- 1Model. Data and rules.
- 2View. Only what is seen.
- 3Data binding. Changes flow both ways.