Skip to Content
Mastering Xamarin.Forms - Second Edition
book

Mastering Xamarin.Forms - Second Edition

by Ed Snider
March 2018
Intermediate to advanced content levelIntermediate to advanced
192 pages
4h 4m
English
Packt Publishing
Content preview from Mastering Xamarin.Forms - Second Edition

Registering the ViewModels

We can also use our IoC container to hold our ViewModels. It is a slightly different model than the one used to register the concrete implementations of our service interfaces—instead of mapping them to an interface, we will simply register them to themselves.

Since our ViewModels are in our core library, we will create another Ninject Module in the core library that will register them, as shown in the following steps:

  1. Add the Portable.Ninject NuGet package to the core project.
  2. Create a new folder in the core project named Modules.
  3. Create a new class in the core project Modules folder named TripLogCoreModule that inherits from Ninject.Modules.NinjectModule:
      public class TripLogCoreModule : NinjectModule      { // ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Xamarin.Forms - Third Edition

Mastering Xamarin.Forms - Third Edition

Ed Snider
Xamarin.Forms Projects - Second Edition

Xamarin.Forms Projects - Second Edition

Daniel Hindrikes, Johan Karlsson
Xamarin.Forms Projects

Xamarin.Forms Projects

Johan Karlsson, Daniel Hindrikes

Publisher Resources

ISBN: 9781788290265Supplemental Content