O'Reilly logo

Mastering Xamarin.Forms by Ed Snider

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

Registering dependencies

As mentioned earlier, each IoC and dependency injection library implements the patterns slightly differently. In this section, we will use Ninject to start adding dependency injection capabilities to our TripLog app. Ninject allows you to create Modules, which are responsible for adding services to the IoC container. The modules are then added to a Kernel that is used to resolve the services by other areas of the app.

You can create a single Ninject Module or many, depending on how your app is structured and how you want to organize your services. For the TripLog app, we will have a Ninject Module in each platform project that is responsible for registering that platform's specific service implementations. We will also ...

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