Design an MVVM ViewModel in Xamarin.Forms - XAM320

A core design goal in UI development is to separate the presentation and domain layers. Experience has shown that this type of loosely-coupled design increases code reuse and simplifies testing. The Model-View-ViewModel (MVVM) pattern has become popular for XAML-based environments like Xamarin.Forms because it helps achieve this separation. This course shows you how to design your applications using MVVM. You will create View Models and use data binding and commanding to connect them to your UI. You will also use the Xamarin.Forms MessagingCenter to communicate between View Models.

Upon completion you will be able to:

Course exercise download

Exercise materials are available from GitHub. The code can be cloned through a desktop Git client or downloaded directly as a ZIP file.

If you are using Windows, try to select a location with a shorter path length to make sure you don't exceed the 260 character limit.

Lecture

Here are the lecture slides.

Exercises

  1. Exercise 1: Driving behavior through properties (XAM320)

    In this exercise, you'll add in selection support, and use data triggers to change the UI based on property values exposed in view models.

  2. Exercise 2: Using commands to run behavior (XAM320)

    You can control the behavior of an application in your ViewModels. For example, what happens when you tap a button or scroll a list? In this exercise, you'll examine commanding and use it to add behavior to your bindable ViewModel.