Skip to content
Przemysław Raciborski edited this page May 1, 2016 · 2 revisions

MvvmCross.Adapter.Ninject - implements Ninject MvxIoCProvider for MvvmCross appplications.

How to use Ninject with MvvmCross?

  1. Type "Install-Package MvvmCross.Adapter.Ninject" in your Nuget Package Manager. (you might have to -IncludePrerelease as there is RC version in nuget feeds)
  2. All your platform specific Setup class should inherit from Ninject* - ex. NinjectMvxWindowsSetup / NinjectMvxAndroidSetup / NinjectMvxIoSSetup.
  3. Implement NinjectDependenciesProvider which should return Portable/Platform specific Ninject Modules (used to register services). Ideally you would have PortableSpecificNinjectDependenciesProvider abstract class in your PCL and implementation of PortableSpecificNinjectDependenciesProvider in each of your platform specific project.
  4. Return appropriate instance of NinjectDependenciesProvider in each of Platform specific Setup GetNinjectDependenciesProvider() method.
Clone this wiki locally