I'm trying out Ninject in my current Xamarin (iOS) project, which uses Storyboards to create the user interface.
The problem is that UIViewController
s are created by the framework, not by Ninject. So I'm injecting the dependencies with property-injection manually:
[Inject]
public IDependency Dependency { get; set; }
public ViewController(IntPtr handle) : base(handle)
{
App.CurrentKernel.Inject(this);
}
But this way I'm breaking the object graph, aren't I? For example the ViewController is actually a child of a UITabBarController
and I would like to use things like InCallScope
ect. How can I fix that?