Using data binding and MVVM
At this point, you should be grasping the basics of Xamarin.Forms, but you may be wondering how the MVVM design pattern fits into the picture. The MVVM design pattern was originally conceived for its use along with XAML and the powerful data binding features XAML provides, so it is only natural that it is a perfect design pattern to be used with Xamarin.Forms.
Let's cover the basics of how data binding and MVVM is set up with Xamarin.Forms:
- Your Model and ViewModel layers will remain mostly unchanged from the MVVM pattern we covered earlier in the module.
- Your ViewModel layer should implement the
INotifyPropertyChangedinterface, which facilitates data binding. To simplify things in Xamarin.Forms, you can use the