We will be using dependency injection in this project with a library called Autofac. Autofac is an open source inversion of control (IoC) container. We will create a Resolver class in order to easily resolve the types that we will add to the container later in this chapter. To do so, we will go through the following steps:
- Install Autofac from NuGet in the GalleryApp, GalleryApp.Android, and GalleryApp.iOS projects.
- In the GalleryApp project, create a new class called Resolver in the root of the project.
- Create a private static IContainer field called container.
- Create a static method called Initialized that has an IContainer argument and set the value of the container field, as in the following code:
using Autofac;
using System;
using System.Collections.Generic;
using System.Text;
namespace GalleryApp
{
public...