0
使用Caliburn.Micro 2.0.1,我编辑了AppBootStrapper.cs以注入我的服务并且它正在工作,但我想知道是否有办法自动注入模拟在设计期间我可以使用MVVM Light的服务版本吗?在设计时向Caliburn Micro注入模拟服务
E.g.
protected override void Configure()
{
_container = new SimpleContainer();
_container.PerRequest<MainViewModel>();
_container.Instance<IWindowManager>(new WindowManager());
_container.Singleton<IEventAggregator, EventAggregator>();
// like this...
if (IsInDesignMode)
{
_container.Instance<IMyService>(new MyServiceMock());
}
else
{
_container.Instance<IMyService>(new MyService());
}
}