View-models with Xamarin native
After we add the libraries, let's start with the AudioPlayer.Portable
project. Create a new folder called ViewModels
, and add a new file called MainPageViewModel.cs
. Let's start implementing our first view-model with MVVMCross:
namespace AudioPlayer.Portable.ViewModels { using MvvmCross.Core.ViewModels; public class MainPageViewModel : MvxViewModel { public MainPageViewModel() { } } }
When we built our Xamarin.Forms
view-models, we created our own base view-model for handling property changes; using this library we can cut a few corners with base properties. MvxViewModel
has a similar implementation with handling property changes; for our MainPage
, we are going to develop the same first page as the last chapter, so let's start with the private properties:
public class MainPageViewModel : MvxViewModel { #region Private Properties private string _descriptionMessage = "Welcome to the Music...