Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 Caliburn Micro 获取接口的实现?像这样的东西:
IMyClass myClass=App.BootStrapper.GetInstance(IMyClass)
哪个会返回 IMyClass 的实现实例?
我找到了:
IMyClass myClass= Caliburn.Micro.IoC.Get<IMyClass >();
但如您所知,您不应该这样做,而是使用构造函数注入或属性注入。但是最好测试一下 IoC 是否可以检测和解析实例。