protected override void Configure() { LogManager.GetLog = t => new DebugLog(t); _container = new WinRTContainer(); _container.RegisterWinRTServices(); _container.RegisterPerRequest(typeof(IMessageService), null, typeof(DefaultMessageService)); _container.RegisterInstance(typeof(IResourceLoader), null, new DefaultResourceLoader()); _container.RegisterSingleton(typeof(IGitHubService), null, typeof(GhService)); _container .PerRequest<MainViewModel>() .PerRequest<NewsViewModel>() .PerRequest<RepositoriesViewModel>() .PerRequest<FollowersViewModel>() .PerRequest<FollowingViewModel>() .PerRequest<OrgsListViewModel>() .PerRequest<RepositoryViewModel>() .PerRequest<RepositoryCommitsViewModel>() .PerRequest<RepositoryIssuesViewModel>() .PerRequest<RepositoryInfoViewModel>() .PerRequest<RepositoryContentsViewModel>() .PerRequest<OrgViewModel>() .PerRequest<MembersViewModel>() .PerRequest<AboutViewModel>() .PerRequest<AuthorizeViewModel>() .PerRequest<HtmlUrlViewModel>(); }
protected override void Configure() { // set logger // TODO: demo customization only LogManager.GetLog = type => new DebugLog(); _container = new WinRTContainer(); _container.RegisterWinRTServices(); // all are singleton, so they won't be recreated _container.Singleton<MainViewModel>() .Singleton<PatternsViewModel>() .Singleton<SoundViewModel>() .Singleton<BingoCardViewModel>() .Singleton<BallCallsViewModel>() .Singleton<PlayerInfoViewModel>() .PerRequest<PatternCountViewModel>(); // need this to allow sharing _container.RegisterSharingService(); // avoid static class _container.RegisterInstance(typeof(Bookkeeper), "Bookkeeper", new Bookkeeper(_container.GetInstance<IEventAggregator>())); PrepareSettings(); }
public void Initialize() { AssemblySource.Instance.Clear(); AssemblySource.Instance.Add(typeof(Registries) .GetTypeInfo().Assembly); _container = new WinRTContainer(); _container.RegisterWinRTServices(); _container.RegisterInstance( typeof(INavigationService), null, new MockNavigation()); _container.RegisterAppServices(); }
protected override void Configure() { LogManager.GetLog = t => new DebugLog(t); container = new WinRTContainer(); container.RegisterWinRTServices(); container.RegisterInstance(typeof(IFavoritesRepository), null, new DefaultFavoritesRepository()); container.RegisterPerRequest(typeof(IMessageService), null, typeof(DefaultMessageService)); container.RegisterPerRequest(typeof(ILocationService), null, typeof(DefaultLocationService)); container .PerRequest<MainViewModel>() .PerRequest<CurrentGasPricesViewModel>(); }