To configure the dependency injection and initialize the Resolver class, we will create a bootstrapper. We will have one shared bootstrapper and one bootstrapper for each platform, to match their specific configurations. We will have different implementations of the IClassifier object in iOS and Android. To create a bootstrapper, go through the following steps:
- Create a new class in the HotDogOrNot project and name it Bootstrapper.
- Write the following code in the new class:
using System.Linq;
using System.Reflection;
using Autofac;
using HotdogOrNot.ViewModels;
using Xamarin.Forms;
namespace HotDogOrNot
{
public class Bootstrapper
{
protected ContainerBuilder ContainerBuilder { get; private
set; }
public Bootstrapper()
{
Initialize();
FinishInitialization();
}
protected virtual void Initialize()
{
ContainerBuilder...