Exemplo n.º 1
0
		public Bootstrapper()
		{
			container = new PhoneContainer(this);
			container.RegisterSingleton(typeof(MainPageViewModel), "MainPageViewModel", typeof(MainPageViewModel));
			container.RegisterSingleton(typeof(FavoritesViewModel), null, typeof(FavoritesViewModel));
			container.RegisterSingleton(typeof(MostViewedViewModel), null, typeof(MostViewedViewModel));
			container.RegisterSingleton(typeof(AboutViewModel), null, typeof(AboutViewModel));
			container.RegisterSingleton(typeof(UserPivotViewModel), "UserPivotViewModel", typeof(UserPivotViewModel));
			container.RegisterSingleton(typeof(UserDetailsViewModel), null, typeof(UserDetailsViewModel));
			container.RegisterSingleton(typeof(UserRepositoriesViewModel), null, typeof(UserRepositoriesViewModel));
			container.RegisterSingleton(typeof(UserWatchingViewModel), null, typeof(UserWatchingViewModel));
			container.RegisterSingleton(typeof(RepositoryPivotViewModel), "RepositoryPivotViewModel", typeof(RepositoryPivotViewModel));
			container.RegisterSingleton(typeof(RepositoryDetailsViewModel), null, typeof(RepositoryDetailsViewModel));
			container.RegisterSingleton(typeof(RepositoryLinksViewModel), null, typeof(RepositoryLinksViewModel));
			container.RegisterSingleton(typeof(RepositoryContributorsViewModel), null, typeof(RepositoryContributorsViewModel));
			container.RegisterSingleton(typeof(IProgressService), null, typeof(ProgressService));
			container.RegisterSingleton(typeof(ISimpleCache), null, typeof(SimpleCache));
			container.RegisterSingleton(typeof(IRequestProcessor), null, typeof(CachingRequestProcessor));

			container.RegisterPerRequest(typeof(IGitHubHost), null, typeof(GitHubHost));

			container.RegisterInstance(typeof(INavigationService), null, new FrameAdapter(RootFrame));
			container.RegisterInstance(typeof(IPhoneService), null, new PhoneApplicationServiceAdapter(PhoneService));

			container.Activator.InstallLauncher<WebBrowserTask>();
			container.Activator.InstallLauncher<EmailComposeTask>();
		}
        protected override void Configure()
        {
            container = new PhoneContainer();

            container.RegisterSingleton(typeof(MainPageViewModel), "MainPageViewModel", typeof(MainPageViewModel));

            container.RegisterInstance(typeof(INavigationService), null, new FrameAdapter(RootFrame));
            container.RegisterInstance(typeof(IPhoneService), null, new PhoneApplicationServiceAdapter(PhoneService));

            //container.Activator.InstallChooser<PhoneNumberChooserTask, PhoneNumberResult>();
            //container.Activator.InstallLauncher<EmailComposeTask>();
        }
        protected override void Configure()
        {
            container = new PhoneContainer();

            container.RegisterSingleton(typeof(MainPageViewModel), "MainPageViewModel", typeof(MainPageViewModel));

            container.RegisterInstance(typeof(INavigationService), null, new FrameAdapter(RootFrame));
            container.RegisterInstance(typeof(IPhoneService), null, new PhoneApplicationServiceAdapter(PhoneService));

            //container.Activator.InstallChooser<PhoneNumberChooserTask, PhoneNumberResult>();
            //container.Activator.InstallLauncher<EmailComposeTask>();

            AddCustomConventions();
        }
Exemplo n.º 4
0
        protected override void Configure()
        {
            _container = new PhoneContainer(this);
            _container.RegisterPerRequest(typeof(MainPageViewModel), "MainPageViewModel", typeof(MainPageViewModel));
            _container.RegisterPerRequest(typeof(PageTwoViewModel), "PageTwoViewModel", typeof(PageTwoViewModel));
            _container.RegisterSingleton(typeof(TabViewModel), null, typeof(TabViewModel));

            _container.RegisterInstance(typeof(INavigationService), null, new FrameAdapter(RootFrame));
            _container.RegisterInstance(typeof(IPhoneService), null, new PhoneApplicationServiceAdapter(PhoneService));

            _container.Activator.InstallChooser<PhoneNumberChooserTask, PhoneNumberResult>();
            _container.Activator.InstallLauncher<EmailComposeTask>();

            AddCustomConventions();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Override to configure the framework and setup your IoC container.
        /// </summary>
        protected override void Configure()
        {
            m_container = new PhoneContainer();

            m_container.RegisterSingleton(
                typeof(MainPageViewModel),
                "MainPageViewModel",
                typeof(MainPageViewModel));

            m_container.RegisterSingleton(
                typeof(ThreadingPageViewModel),
                "ThreadingPageViewModel",
                typeof(ThreadingPageViewModel));

            m_container.RegisterSingleton(
                typeof(SterlingPageViewModel),
                "SterlingPageViewModel",
                typeof(SterlingPageViewModel));

            m_container.RegisterSingleton(
                typeof(SterlingExtensionsPageViewModel),
                "SterlingExtensionsPageViewModel",
                typeof(SterlingExtensionsPageViewModel));

            m_container.RegisterSingleton(
                typeof(CodeOnlyPageViewModel),
                "CodeOnlyPageViewModel",
                typeof(CodeOnlyPageViewModel));

            m_container.RegisterInstance(
                typeof(ICargoRepository),
                null,
                new CargoRepository());

            m_container.RegisterInstance(
                typeof(INavigationService),
                null,
                new FrameAdapter(RootFrame));

            m_container.RegisterInstance(
                typeof(IPhoneService),
                null,
                new PhoneApplicationServiceAdapter(PhoneService));

            m_container.Activator.InstallChooser <PhoneNumberChooserTask, PhoneNumberResult>();
            m_container.Activator.InstallLauncher <EmailComposeTask>();
        }
Exemplo n.º 6
0
        private void RegisterServices()
        {
            _phoneContainer.RegisterInstance(typeof(IAnalytics), null, _analytics);

            _phoneContainer.RegisterHandler(typeof(ILocalizationManager), null, c => Application.Current.Resources["Localization"]);
            _phoneContainer.RegisterHandler(typeof(IBusyIndicatorManager), null, c => BusyIndicatorManager.Create((PhoneApplicationPage)RootFrame.Content));
            _phoneContainer.Singleton <SettingsController>();
            _phoneContainer.PerRequest <INotificationsService, NotificationsService>();
            _phoneContainer.PerRequest <IErrorHandler, ErrorHandler>();

            _phoneContainer.PerRequest <ITileManager, TileManager>();
            _phoneContainer.PerRequest <IBookRepository, BookRepository>();
            _phoneContainer.PerRequest <ICatalogRepository, CatalogRepository>();
            _phoneContainer.PerRequest <IWebDataGateway, WebDataGateway>();
            _phoneContainer.PerRequest <IWebClient, WebClient.WebClient>();
            _phoneContainer.PerRequest <ICatalogReaderFactory, CatalogReaderFactory>();
            _phoneContainer.PerRequest <ICatalogAuthorizationFactory, CatalogAuthorizationFactory>();
            _phoneContainer.PerRequest <IAcquisitionServiceFactory, AcquisitionServiceFactory>();

            _phoneContainer.Singleton <BookmarksController>();
            _phoneContainer.PerRequest <IBookmarkRepository, BookmarkRepository>();

            _phoneContainer.Singleton <SearchInBookController>();

            _phoneContainer.PerRequest <BookSearch>();

            _phoneContainer.Singleton <ISdCardStorage, SdCardStorage>();
            _phoneContainer.PerRequest <DataBaseInitializer>();

            _phoneContainer.PerRequest <IStorageStateSaver, StorageStateSaver>();

            _phoneContainer.PerRequest <ILiveLogin, LiveLogin>();
            _phoneContainer.PerRequest <ISkyDriveService, SkyDriveService>();

            _phoneContainer.Handler <AppSettings>(container => AppSettings.Default);

            _phoneContainer.PerRequest <SharingDataModel>();

            _phoneContainer.PerRequest <IBusyOverlayManager, BusyOverlayManager>();

            _phoneContainer.PerRequest <BookTool>();

            _phoneContainer.Singleton <CatalogController>();

            _phoneContainer.PerRequest <IFileLoadingFactory, FileLoadingFactory>();
            _phoneContainer.Singleton <DownloadController>();
            _phoneContainer.Singleton <IBookDownloader, BookDownloader>();
            _phoneContainer.Singleton <IDownloadsContainer, DownloadsContainer>();
            _phoneContainer.PerRequest <IBookDownloadsRepository, BookDownloadsRepository>();
        }
Exemplo n.º 7
0
        private void RegisterServices(PhoneContainer container)
        {
            container.RegisterHandler(typeof(IGlobalBusyIndicatorManager), string.Empty,
                                      c => GlobalBusyIndicatorManager.Create((PhoneApplicationPage)RootFrame.Content));

            container.Singleton <IServiceConfiguration, ServiceConfiguration>();
            container.Singleton <IWebConfiguration, WebConfiguration>();
            container.PerRequest <IApplicationConfiguration, ApplicationConfiguration>();

            container.PerRequest <IRequestBodyBuilder, RequestBodyBuilder>();
            container.PerRequest <IWebChannel, ZabbixWebChannel>();

            container.PerRequest <IUserProxyServer, ZabbixUserProxyServer>();
            container.PerRequest <IUserManagmentFacade, UserManagmentFacade>();
            container.PerRequest <IHostGroupProxyServer, ZabbixHostGroupProxyServer>();
            container.PerRequest <IHostProxyServer, ZabbixHostProxyServer>();
            container.PerRequest <ITriggerProxyServer, ZabbixTriggerProxyServer>();
            container.PerRequest <IEventProxyServer, ZabbixEventProxyServer>();
            container.PerRequest <IServerChecker, ZabbixServerChecker>();
            container.PerRequest <IGraphsProxyServer, ZabbixGraphsProxyServer>();
            container.PerRequest <IDataProxyServer, ZabbixDataProxyServer>();

            container.PerRequest <IDeviceManagementService, DeviceManagementService>();
            container.Singleton <IPushChannelService, PushChannelService>();

            container.Singleton <IApplicationSettings, ApplicationSettings>();
            container.PerRequest <ISettingsStorage, SettingsStorage>();
            container.PerRequest <IErrorHandler, ErrorHandler>();
            container.PerRequest <IErrorReporter, ErrorReporter>();
            container.PerRequest <IMessagingService, MessagingService>();
            container.PerRequest <IDeviceInformationManager, DeviceInformationManager>();
            container.PerRequest <INetworkStateManager, NetworkStateManager>();

            container.Singleton <IFavoritesStorage <Trigger>, FavoritesStorage <Trigger> >();
            container.Singleton <IFavoritesStorage <Graph>, FavoritesStorage <Graph> >();
            container.PerRequest <IIsolatedStorageFactory, IsolatedStorageFactory>();

            container.Singleton <IAnalyticsService, FlurryAnalytics>();

            var navigationServiceResolver = new NavigationServiceResolver(RootFrame);

            container.RegisterInstance(typeof(INavigationServiceResolver), null, navigationServiceResolver);

            container.Singleton <AnaliticsNavigationPageLogger>();
            container.GetInstance(typeof(AnaliticsNavigationPageLogger), null);
        }