private void RegisterDependencies() { DependencyInjector di = DependencyInjector.Instance; // Singleton services di.CreateSingleton <IViewResolver, ViewResolver>(); di.CreateSingleton <INavigator, Navigator>(typeof(IViewResolver)); di.CreateSingleton <ISensor, Kinect>(); //View resolver setup IViewResolver vr = di.GetSingleton <IViewResolver>(); vr.Register <MainViewModel, MainView>(); vr.Register <DisposeViewModel, DisposeView>(); }
public static void Register(DependencyInjector injector) { injector.CreateSingleton <ViewResolver, UwpViewResolver>(); injector.CreateSingleton <Navigator, UwpNavigator>(typeof(ViewResolver)); injector.CreateSingleton <Viewport, UwpViewport>(); injector.CreateSingleton <MusicLoader, UwpMusicLoader>(); injector.CreateSingleton <HttpService, UwpHttpService>(); injector.CreateSingleton <Deserialiser, JsonDeserialiser>(); injector.CreateSingleton <PhotoService, UnsplashService>(typeof(HttpService), typeof(Deserialiser)); ViewResolver viewResolver = injector.GetSingleton <ViewResolver>(); viewResolver.Register <MainViewModel, MainView>(); }