我正在尝试在使用泛型的电话容器上注册服务。
public class JsonWebClient<TResult> : IJsonWebClient<TResult>
我是这样注册的:
protected override void Configure()
{
_container = new PhoneContainer(RootFrame);
_container.RegisterPhoneServices();
_container.Singleton<MainPageViewModel>();
_container.PerRequest<LoginViewModel>();
_container.RegisterPerRequest(typeof(IJsonWebClient<>), "jsonwebclient", typeof(JsonWebClient<>));
}
然后我有一个服务(注册服务),我JsonWebClient
在构造函数中注入
public SignupService(IJsonWebClient<UserDto> webClient)
{
_webClient = webClient;
}
我的问题是它webClient
始终为空。