Why MVVM
In UI development, we can split it into 3 components as following;
- View (UI)
- Model (Business Logic and Data Displayed in UI)
- Glue code (Event handling, binding)
For Traditional UI development, The Model and Glue Code are being written as a part of view definition class itself. Which cause a tightly coupling between these item.
Separation of Concerns
Here's the keyword on why we would like to use MVVM. We want to separate these component(View, Model, and Glue Code) out of each other and make it loosedly coupling between each other.
What is MVVM
The MVVM pattern includes three key parts:
- Model (Business rule, data access, model classes)
- View (User interface (XAML))
- ViewModel (Agent or middle man between view and model)
Outline
let's see how can we implement MVVM using C#.
No comments:
Post a Comment