示例#1
0
        protected override void Configure()
        {
            container = new WinRTContainer();
            container.RegisterWinRTServices();

            container.Singleton<IFreeletics, Freeletics>();
            container.Singleton<ISpeechService, SpeechService>();

            container
                .PerRequest<LoadingViewModel>()
                .PerRequest<MyWeekViewModel>()
                .PerRequest<PeopleViewModel>()
                .PerRequest<WorkoutViewModel>()
                .PerRequest<TrainingViewModel>()
                .PerRequest<WorkoutDetailViewModel>()
                .PerRequest<ExercisesViewModel>()
                .PerRequest<ExerciesSeparatorViewModel>()
                .PerRequest<LeaderViewModel>()
                .PerRequest<LetsGoViewModel>()
                .PerRequest<AboutViewModel>()
                .PerRequest<FreeTrainingViewModel>()
                .PerRequest<FreeWorkoutViewModel>()
                .PerRequest<RunViewModel>()
                .PerRequest<MediaPlayerViewModel>();
        }
示例#2
0
        protected override void Configure()
        {
            CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;

            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                var statusBar = StatusBar.GetForCurrentView();
                statusBar.BackgroundColor = (Color) Current.Resources["SystemAccentColor"];
                statusBar.BackgroundOpacity = 1;
                statusBar.ForegroundColor = (Color) Current.Resources["SystemAltHighColor"];
            }

            container = new WinRTContainer();
            container.RegisterWinRTServices();

            container.Singleton<SelfwinApp>();
            container.Singleton<IAppNavigation, SelfwinNavigation>();

            container.Singleton<ShellViewModel>();
            container.PerRequest<AllItemsViewModel>();
            container.PerRequest<ReadItemViewModel>();

            container.PerRequest<AllTagsViewModel>();
            container.PerRequest<AllSourcesViewModel>();
            container.PerRequest<SettingsViewModel>();
        }
示例#3
0
		protected override async void Configure()
		{
			container = new WinRTContainer();
			container.RegisterWinRTServices();
			container.Singleton<LoggingManager>();
			container.Singleton<IAppSettings, ApplicationSettings>();
			container.Singleton<TimerService>();
			container.Singleton<ThermostatManager>();

			var types = GetType().GetTypeInfo().Assembly.GetTypes()
				.Where(t => t.Namespace == "Sannel.House.Controller.ViewModels");
			foreach (var type in types)
			{
				var typeInfo = type.GetTypeInfo();
				if (!typeInfo.IsAbstract)
				{
					var sa = typeInfo.GetCustomAttribute<SingletonAttribute>();
					if(sa != null)
					{
						container.RegisterSingleton(type, type.FullName, type);
					}
					else
					{
						container.RegisterPerRequest(type, type.FullName, type);
					}
				}
			}
		}
        protected override void Configure()
        {
            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            _container.Singleton<MainPageViewModel>();
            _container.Singleton<Screen1ViewModel>();
            _container.Singleton<Screen2ViewModel>();
            _container.Singleton<Screen3ViewModel>();
        }
示例#5
0
        protected override void Configure()
        {
            container = new WinRTContainer();

            container.RegisterWinRTServices();
            container.Singleton<ICache<string, ObservableCollection<Photo>>, InMemoryCache<string, ObservableCollection<Photo>>>();
            container.Singleton<ICache<string, string>, InMemoryCache<string, string>>();
            container.Singleton<IClient, Client>();
            container.Singleton<MainPageViewModel>();
            container.PerRequest<PivotPageViewModel>();
            container.PerRequest<MapPageViewModel>();
            AddConventions();
        }
        protected override void Configure()
        {
            container = new WinRTContainer();
            container.RegisterWinRTServices();
            

            container.PerRequest<MainViewModel>();
            container.PerRequest<DetailViewModel>();

            container.Singleton<IDataManager, DataManagerOnlinerTech>();
			container.Singleton<IWriteReadData, LocalDataManager>();

            MessageBinder.SpecialValues.Add("$clickeditem", c => ((ItemClickEventArgs)c.EventArgs).ClickedItem);

        }
示例#7
0
        protected override void Configure()
        {
            container = new WinRTContainer();
            container.RegisterWinRTServices();

            container.Singleton<IDicomFileReaderService, DicomFileReaderService>().PerRequest<ShellViewModel>();
        }
示例#8
0
        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();
        }
示例#9
0
        protected override void Configure()
        {
            ViewModelLocator.AddNamespaceMapping("Hubb.App.UWP.Views", "Hubb.Core.ViewModels");
            ViewLocator.AddNamespaceMapping("Hubb.Core.ViewModels", "Hubb.App.UWP.Views");

            container = new WinRTContainer();
            container.RegisterWinRTServices();

            container.Instance<IGitHubClient>(new GitHubClient(new ProductHeaderValue("hubb-uwp", "1.0.0")));

            container
                .Singleton<IAppNavigationService, AppNavigationService>()
                .Singleton<IAuthenticationService, AuthenticationService>()
                .Singleton<IRepositoryService, RepositoryService>();

            container
                .PerRequest<LoginViewModel>()
                .PerRequest<RepositorySearchViewModel>();

            Coroutine.Completed += (s, e) =>
            {
                if (e.Error == null)
                    return;

                Debug.Write(e.Error.Message);
            };

            ConventionManager.AddElementConvention<AutoSuggestBox>(AutoSuggestBox.TextProperty, "Text", "QuerySubmitted");
        }
示例#10
0
        protected override void Configure()
        {
            container = new WinRTContainer();
            container.RegisterWinRTServices();

            container
               .Singleton<ICredentialsService, SettingsCredentialsService>();
        }
示例#11
0
        protected override void Configure()
        {
            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            _container.PerRequest<MainPageViewModel>();
            _container.PerRequest<CategoryDetailViewModel>();
            _container.Singleton<ICategoriesService, CategoriesService>();
        }
示例#12
0
        protected override void Configure()
        {
            LogManager.GetLog = type => new DebugLog();

            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            _container.Singleton<HomePageViewModel>();
        }
示例#13
0
        protected override void Configure()
        {
            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            //MessageBinder.SpecialValues.Add("$sendercontext", c => c.Source.DataContext);

            _container
                .Singleton<IAuthenticationService, AuthenticationService>()
                .Singleton<VideosRepository>()
                .PerRequest<MainViewModel>()
                .PerRequest<GroupViewModel>()
                .PerRequest<ShellViewModel>();
        }
示例#14
0
        protected override void Configure()
        {
            ViewModelLocator.AddNamespaceMapping("Hubb.App.UWP.Views", "Hubb.Core.ViewModels");
            ViewLocator.AddNamespaceMapping("Hubb.Core.ViewModels", "Hubb.App.UWP.Views");

            MessageBinder.SpecialValues.Add("$clickedItem", c => ((ItemClickEventArgs)c.EventArgs).ClickedItem);

            container = new WinRTContainer();

            container.RegisterWinRTServices();

            container.Instance<IGitHubClient>(new GitHubClient(new ProductHeaderValue("Hubb", "0.0.1")));
            container.Singleton<IHubbClient, OfflineHubbClient>();
            container.PerRequest<ShellViewModel>();
        }
示例#15
0
        protected override void Configure()
        {
            container = new WinRTContainer();

            container.RegisterWinRTServices();

            container.Singleton<ISevenDigitalClient, SevenDigitalClient>();

            container
                .PerRequest<ChartViewModel>()
                .PerRequest<ReleaseDetailsViewModel>();

            ConfigureWindow();
            ConfigureHardware();
        }
示例#16
0
文件: App.xaml.cs 项目: edjo23/shop
        protected override void Configure()
        {
            Container = new WinRTContainer();
            Container.RegisterWinRTServices();

            Container.PerRequest<ShellViewModel>();
            Container.PerRequest<HomeViewModel>();
            Container.PerRequest<CashHomeViewModel>();
            Container.PerRequest<AccountsViewModel>();
            Container.PerRequest<CustomerViewModel>();
            Container.PerRequest<PinEntryViewModel>();
            Container.PerRequest<SaleViewModel>();
            Container.PerRequest<PayViewModel>();
            Container.PerRequest<LoanViewModel>();
            Container.PerRequest<ReceiptViewModel>();
            Container.PerRequest<AccountViewModel>();
            Container.PerRequest<AccountTransactionListViewModel>();
            Container.PerRequest<ProcessViewModel>();
            Container.PerRequest<MessageBoxViewModel>();
            Container.PerRequest<SettingsViewModel>();
            Container.PerRequest<InvoicePopupViewModel>();
            Container.PerRequest<PinPopupViewModel>();

            Container.Singleton<IServiceClientFactory, WindowsStoreServiceClientFactory>();

            Container.PerRequest<IApplicationService, ApplicationServiceProxy>();
            Container.PerRequest<ICustomerService, CustomerServiceProxy>();
            Container.PerRequest<IProductService, ProductServiceProxy>();
            Container.PerRequest<IInvoiceService, InvoiceServiceProxy>();
            Container.PerRequest<IDiscountService, DiscountServiceProxy>();

            Container.PerRequest<ICardHandler, CardReadHandler>();
            Container.PerRequest<ICardReadService, CardReadServiceProxy>();
            Container.PerRequest<ICardWriteService, CardWriteServiceProxy>();

            Container.Singleton<ScreenCoordinator>();
            Container.Singleton<CardService>();
            Container.PerRequest<ImageService>();

            var settings = Container.RegisterSettingsService();
            settings.RegisterCommand<SettingsViewModel>("Options");
        }
示例#17
0
        /// <summary>
        /// Caliburn.Micro configuration, 
        /// </summary>
        protected override void Configure()
        {
            // Logging configuration
            LogManager.GetLog = t => new DebugLog(t);

            // IoC configuration
            container = new WinRTContainer();

            container.RegisterWinRTServices();

            container
                .Singleton<IAuthenticationService, AuthenticationService>()
                .Singleton<ITeamService, TeamService>()
                .Singleton<INotificationService, NotificationService>()
                .Singleton<IPersistenceService, PersistenceService>()

                .PerRequest<LoginViewModel>()
                .PerRequest<MapViewModel>()
                .PerRequest<PasswordReminderViewModel>()
                .PerRequest<PasswordReminderSentViewModel>()
                .PerRequest<RegisterViewModel>()
                .PerRequest<TeamAdminViewModel>()
                .PerRequest<TeamCreatedViewModel>()
                .PerRequest<TeamCreationViewModel>()
                .PerRequest<TeamJoinViewModel>()
                .PerRequest<TeamSearchViewModel>()
                .PerRequest<TeamViewModel>();

            var config = new TypeMappingConfiguration
            {
                NameFormat = "{0}{1}",
                IncludeViewSuffixInViewModelNames = false
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

            // Navigation configuration
            PrepareViewFirst();
        }
示例#18
0
        protected override void Configure()
        {
            ViewModelLocator.AddNamespaceMapping("Spending.App.Windows.Views", "Spending.Core.ViewModels");
            ViewLocator.AddNamespaceMapping("Spending.Core.ViewModels", "Spending.App.Windows.Views");

            container = new WinRTContainer();
            container.RegisterWinRTServices();

            container
                .Instance<IMobileServiceClient>(new MobileServiceClient("https://spending.azurewebsites.net"));

            container
                .Singleton<IAuthenticationService, AuthenticationService>()
                .Singleton<IApplicationNavigationService, ApplicationNavigationService>()
                .Singleton<IExpenseService, ExpenseService>()
                .Singleton<INotificationsService, NotificationsService>();

            container
                .PerRequest<LoginViewModel>()
                .PerRequest<CurrentExpensesViewModel>()
                .PerRequest<AddExpenseViewModel>();
        }
示例#19
0
        protected override void Configure()
        {
            ViewModelLocator.AddNamespaceMapping("NDC.Build.App.UWP.Views", "NDC.Build.Core.ViewModels");
            ViewLocator.AddNamespaceMapping("NDC.Build.Core.ViewModels", "NDC.Build.App.UWP.Views");

            MessageBinder.SpecialValues.Add("$clickedItem", c => ((ItemClickEventArgs)c.EventArgs).ClickedItem);

            container = new WinRTContainer();

            container.RegisterWinRTServices();

            container
                .Singleton<ITeamServicesClient, OfflineTeamServicesClient>()
                .Singleton<IAuthenticationService, OfflineAuthenticationService>()
                .Singleton<IApplicationNavigationService, ApplicationNavigationService>()
                .Singleton<ICredentialsService, SettingsCredentialsService>()
                .Singleton<IDialogService, ContentDialogService>();

            container
                .PerRequest<LoginViewModel>()
                .PerRequest<ProjectsViewModel>()
                .PerRequest<BuildsViewModel>();
        }
示例#20
0
		protected override void Configure()
		{
			container = new WinRTContainer();
			container.RegisterWinRTServices();
			

			container.Singleton<IAppSettings, ApplicationSettings>();
			container.PerRequest<IDataContext, LocalDataContext>();
			container.Singleton<TimerService>();
			container.Singleton<IThermostatService, ThermostatService>();
			container.Singleton<IServerSource, ServerDataContext>();
			container.PerRequest<ISyncService, SyncService>();


			// ViewModels
			container.Singleton<ShellViewModel>();
			container.PerRequest<ConfigureViewModel>();
			container.PerRequest<BootViewModel>();
			container.PerRequest<HomeViewModel>();

			//container.Singleton<MainViewModel>();
			//container.Singleton<HomeViewModel>();
			//container.Singleton<SettingsViewModel>();
			//container.Singleton<WeatherViewModel>();
			//container.Singleton<SettingsDevicesViewModel>();
			//container.Singleton<SettingsWUndergroundViewModel>();
			//container.Singleton<TemperatureViewModel>();
			//container.Singleton<TimerService>();
			//container.Singleton<SyncService>();
		}
示例#21
0
        private void RegisterServices()
        {
            _container = new WinRTContainer();
            _container.Activated += TryRegister;
            _container.RegisterWinRTServices();

            _container
                .AssemblyContainingType<MainViewModel>()
                .RegisterViewModels();

#if WINDOWS_PHONE_APP
            _container.Singleton<BackButtonHandler>();
#endif

            _container.Instance(AutoMaps.Initialize());
            _container.Singleton<ICacheService, CacheService>();
            _container.Singleton<IFilePickerService, FilePickerService>();
            _container.Singleton<IRegisteredDbsService, RegisteredDbsService>();

            _container.PerRequest<IEntrySubViewModel, EntryDetailsViewModel>();
            _container.PerRequest<IEntrySubViewModel, EntryNotesViewModel>();
            _container.PerRequest<IEntrySubViewModel, EntryAttachmentsViewModel>();
            _container.PerRequest<IEntrySubViewModel, EntryFieldsViewModel>();
        }