March 2018
Intermediate to advanced
192 pages
4h 4m
English
Now that our platform services, navigation service, and ViewModels have all been registered in the IoC container, we will need to add the Ninject Modules that we created to the Ninject Kernel. We will do this in our main Xamarin.Forms.Application class: App.
In order to get our platform modules into the App class, which is in our core library, we will simply update the App constructor to take in INinjectModule parameters. Then, each platform-specific project will be responsible for passing in its respective Ninject Module when it loads the App at startup, as shown in the following steps:
public App (params INinjectModule[] platformModules) { // ... ...