O'Reilly logo

Mastering Xamarin UI Development - Second Edition by Steven F. Daniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required