Model-View-ViewModel (MVVM) Approach with Wisej.NET

What is MVVM?

MVVM is a way of separating an application into three interconnected parts: the data storage (Model), user interface (View), and connection between the view and the model (ViewModel).

The Model represents the application's data. It provides an interface for storing, accessing and updating the data. The model exposes the data in the database. The ViewModel connects the data in the model to the view via databinding. The ViewModel is also responsible for setting up event handlers that trigger when items in the view are interacted with by the user. The View focuses on the user interface and displaying the data provided by the ViewModel. It does not directly interact with the database or handle data retrieval operations. Instead, it binds to properties exposed by the ViewModel to display the data and captures user input to pass it back to the ViewModel for further processing.

MVVM enables a clear separation of concerns which improves code maintainability. ViewModel components can be shared across multiple views, which promotes code reusability. Data binding automates UI updates when data changes, leading to a more responsive user interface. MVVM's testability allows for focused unit testing of the ViewModel, ensuring robust and reliable application behavior.

Creating a Wisej.NET Application with MVVM Architecture

You can find the full code of the sample project here:

Last updated


© Ice Tea Group LLC, All Rights Reserved.