Learning Xamarin: MVVM Light and Xamarin Forms

Today I’m going to kick off a series of postings on creating an application using Xamarin Forms and theMVVM Light Toolkit. This is part of a larger series on Learning Xamarin.

To get started, I created a new Xamarin Forms project in Xamarin Studio on my Mac and named it BookLender. The purpose of this app will be to help me track who borrows my books (a problem that is greatly diminished by the fact that the last few hundred books I’ve bought have been Kindle books, but we still have a few thousand bound books that folks like to borrow now and again. I’m a huge fan of GoodReads!).

I’ve used the MVVM Light Toolkit in the past, but it has been a few years, and this will be my first experimentation with using it with Xamarin. I did talk to Laurent Bugnion (author of the toolkit) about it on my podcast, and he told me to start with the “Libraries only PCL” version through NuGet, which I have added to all three projects (the core, iOS and Android projects). Because I’m building this in Xamarin Studio on the Mac, I won’t (for now) have a Windows Phone version – though I can migrate everything later and add that as well.

In my previous article I attempted to explain why MVVM is inherently desirable and especially so with Xamarin Forms which supports both XAML and DataBinding. In this article I will create a dead simple example (actually, I’ll steal Lauren’t simple example) to get my feet wet.