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());
}
}