We will start by creating the ViewModel, which will handle what will happen when a user taps one of the buttons. Let's set this up by going through the following steps:
- Create a new class called MainViewModel in the ViewModels folder.
- Add ViewModel as a base class for MainViewModel.
- Create a private field of the IClassifier type and call it classifier.
- Create a constructor that has the IClassifier as a parameter.
- Set the value of the classifier field to the value of the parameter in the constructor, as shown in the following code:
using System.IO;using System.Linq;using System.Windows.Input;using HotdogOrNot.Models;using HotdogOrNot.Views;using Xamarin.Forms; public class MainViewModel : ViewModel{ private IClassifier ...