public void InitializeContainer(IDependencyContainer container) { container .Register<IHttpConnector, HttpConnector>(() => new HttpConnector()) .Register<IHttpFileHandler, WebClientHttpFileHandler>(() => new WebClientHttpFileHandler()) .RegisterInstance<ILocalStorage, IsolatedLocalStorage>("wp8", IsolatedLocalStorage.Instance) .RegisterInstance<ITraceWriter, DebugTraceWriter>(new DebugTraceWriter()); ; var deviceState = new WPDeviceState( container.Build<ILocalStorage>("wp8"), container.Build<IJsonSerializer>()); container.RegisterInstance<IDeviceState, WPDeviceState>("wp8", deviceState); var appState = new WPApplicationState( container.Build<ILocalStorage>("wp8"), container.Build<IJsonSerializer>()); container.RegisterInstance<IApplicationState, WPApplicationState>("wp8", appState); }
public void InitializeContainer(IDependencyContainer container) { container .Register <IHttpConnector, HttpConnector>(() => new HttpConnector()) .Register <IHttpFileHandler, WebClientHttpFileHandler>(() => new WebClientHttpFileHandler()) .RegisterInstance <ILocalStorage, IsolatedLocalStorage>("wp8", IsolatedLocalStorage.Instance) .RegisterInstance <ITraceWriter, DebugTraceWriter>(new DebugTraceWriter()); ; var deviceState = new WPDeviceState( container.Build <ILocalStorage>("wp8"), container.Build <IJsonSerializer>()); container.RegisterInstance <IDeviceState, WPDeviceState>("wp8", deviceState); var appState = new WPApplicationState( container.Build <ILocalStorage>("wp8"), container.Build <IJsonSerializer>()); container.RegisterInstance <IApplicationState, WPApplicationState>("wp8", appState); }