I have a WPF view\view-model binding pattern where I would like to resolve dependencies from Ninject by name only, rather than by type or type+name. I want to bind my view-models by name with Ninject, and then refer to the view-models in views by this name for view injection (via Caliburn.Micro).
I realize that in practice multiple types could be registered against the same name, but I want a convention type pattern and am willing to live with this case. I only need to resolve to "object" for WPF binding to work.
For instance, is there some way I can:
The only way is to bind them as object
kernel.Bind<object>().To<MyClass>().Named("A")
kernel.Get<object>("A");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With