Skills Expanded

Applying MVVM in Xamarin.Forms Applications

What you'll learn

In this project, we will take a simple application UI that was already built in XAML and use the Model-View-ViewModel design pattern to implement logic and features in a maintainable, testable, and organized manner.

Table of contents

  • Setup your local environment for projects. We'll walk you through everything you need to know to setup your local instance and look around at the code you'll be using for this project.
Add Simple Data-binding to the View
  • In this first module, take an existing application, where someone has already designed a View in XAML, and implement some basic data-binding features.
Author a ViewModel Class for Your View
  • In this module, build a ViewModel class that you can use to implement properties and actions for your View in a loosely coupled manner.
Add Behavior to the ViewModel Class
  • In this module, enhance the ViewModel class by adding a custom command and automatic view-notification functionality when a property is changed.
Create a Model Class and an ObservableCollection in the ViewModel Class
  • In this module, build a Model class representing objects managed as a collection in the ViewModel.
Bind the ObservableCollection to a ListView in the View
  • In this final module, take the collection you created in the ViewModel and render it in the View using a collection control.

About the author

Sidney Andrews is an Azure MVP and a Microsoft Certified Training Regional Lead. Sidney has authored multiple developer and Azure courses for Microsoft while contributing free open-source educational content to edX. Sidney has also been featured as a presenter on Channel 9, Ignite and Build. His specialties include Azure, NoSQL, XAML, C# and TypeScript. Sidney is a native of Richmond, VA.

Ready to upskill? Get started