Summary

Completed

In this module, you learned about the Model-View-ViewModel (MVVM) pattern and its application in .NET MAUI apps. The MVVM pattern helps to move most UI behavior logic to unit-testable classes called viewmodels, thus addressing the challenge of writing unit tests against code-behind files. You also learned about the roles of the model, view, and viewmodel in an MVVM application. The module further delves into the responsibilities of the viewmodel, including formatting, converting, and enriching data from the model to suit the current view's requirements. The MVVM Toolkit library, which provides a starting implementation for building modern apps using the MVVM pattern, was also introduced.

The main takeaways from this module include understanding the role of the viewmodel and how it's designed to to fit a view. This involved updating the MovieListViewModel to add a SelectedMovie property, and improve selection in the MovieListPage view using the MVVM pattern. Additionally, you learnt about the command pattern as a solution for handling UI components like Button or MenuItem activation. The module also covered the conversion of the Delete menu's event handler into a command in the "movie list" app.