在阅读了对 Caliburn.Micro的精彩介绍之后,我似乎错过了一件事,那就是如何使用期望参数的构造函数注册一个类?
这里有问题的行是:
_container.PerRequest<IMobileServiceClient, MobileServiceClient>();
public class Bootstrapper : PhoneBootstrapper
{
private PhoneContainer _container;
protected override void Configure()
{
_container = new PhoneContainer();
_container.RegisterPhoneServices(RootFrame);
_container.PerRequest<MainPageViewModel>();
_container.PerRequest<IRepository, Repository>();
_container.PerRequest<IMobileServiceClient, MobileServiceClient>();
AddCustomConventions();
}
//...
}