Creating the WalksMainPageViewModel using C#

Now that we have created our BaseViewModel class which will be used and inherited by each of the ViewModels that we create, the next step is to start creating the WalksMainPageViewModel class that will be used by our WalksMainPage.

The WalksMainPageViewModel ViewModel class will be used to populate our data model and display the information within our ListView by setting the BindingContext within the ContentPage.

Let's take a look at how we can achieve this by following these steps:

  1. Ensure that the TrackMyWalks solution is open within the Visual Studio for Mac IDE.
  2. Next, right-click on the ViewModels folder and choose Add|New File... from the pop-up menu.
  1. Then, choose the Empty Class option ...

Get Mastering Xamarin UI Development - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.