示例#1
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            ViewModelLocationProvider.Register <MainMenuView, MainMenuViewModel>();
            regionManager.RegisterViewWithRegion("PartLeftMenu", typeof(MainMenuView));
        }
示例#2
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            ViewModelLocationProvider.Register <ParametrageView, ParametrageViewModel>();
            regionManager.RegisterViewWithRegion("PartCenterPanel", typeof(ParametrageView));
        }
示例#3
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            regionManager.RegisterViewWithRegion(VolumeManagementRegionNames.Master, typeof(VolumesListView));
            ViewModelLocationProvider.Register <VolumesListView, VolumesListViewModel>();
        }
示例#4
0
        protected override void ConfigureViewModelLocator()
        {
            base.ConfigureViewModelLocator();

            ViewModelLocationProvider.Register <MainWindow, MainWindowViewModel>();
            ViewModelLocationProvider.Register <ChatWindow, ChatViewModel>();
        }
示例#5
0
        private void ConfigureGem(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterInstance(Options);

            containerRegistry.RegisterSingleton <ILoggerFacade, GemLogger>();
            containerRegistry.RegisterSingleton <ExceptionHandler, DefaultExceptionHandler>();

            if (Options.UseAppCenter)
            {
                containerRegistry.RegisterManySingleton <AppCenterLogger>(typeof(ILogger), typeof(ILoggerFacade), typeof(IAnalyticsService), typeof(ICrashesService));
                HookAppCenterNavigationEvents();
            }

            containerRegistry.RegisterSingleton(typeof(AppInitializer), Options.InitializerType);

            if (Options.SplashPageType == null)
            {
                Options.SplashPageType = typeof(ContentPage);
            }

            containerRegistry.RegisterForNavigation(Options.SplashPageType, Options.SplashPageType.Name);
            ViewModelLocationProvider.Register(Options.SplashPageType.ToString(), typeof(AppInitializer));

            containerRegistry.RegisterForNavigation <DefaultChangeEnvPage, DefaultChangeEnvViewModel>();
        }
示例#6
0
        protected override void ConfigureViewModelLocator()
        {
            base.ConfigureViewModelLocator();

            ViewModelLocationProvider.Register <LabelMakerControl, LabelMakerViewModel>();
            ViewModelLocationProvider.Register <CsvConverterControl, CsvConverterViewModel>();
        }
示例#7
0
 protected override void ConfigureViewModelLocator()
 {
     base.ConfigureViewModelLocator();
     ViewModelLocationProvider.Register <MainWindow, MainWindowViewModel>();
     ViewModelLocationProvider.Register <browseButton, browseButtonViewModel>();
     ViewModelLocationProvider.Register <MascotWindow, MascotWindowViewModel>();
 }
示例#8
0
        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterSingleton <IPlayerBroker, SpotifyBroker>();

            ViewModelLocationProvider.Register <SongView, SongViewModel>();
            ViewModelLocationProvider.Register <SettingsView, SettingsViewModel>();
        }
示例#9
0
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            ViewModelLocationProvider.Register <MainWindow, MainWindowViewModel>();

            // Servisi
            containerRegistry.RegisterSingleton <IDbService, DBService>();
        }
示例#10
0
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            ViewModelLocationProvider.Register <MainWindow, MainViewModel>();

            //  containerRegistry.Register<i>(new C);
            ////throw new NotImplementedException();
        }
        public void RegisterTypes(Prism.Ioc.IContainerRegistry containerRegistry)
        {
            containerRegistry.Register <IWatchListService, WatchListService>();

            ViewModelLocationProvider.Register <WatchListView, WatchListViewModel>();
            ViewModelLocationProvider.Register <AddWatchView, AddWatchViewModel>();
        }
示例#12
0
 public void RegisterTypes(IContainerRegistry containerRegistry)
 {
     containerRegistry.Register <RouteEditorNavigationCommand>();
     containerRegistry.Register <IRouteEditorViewModel, RouteEditorViewModel>();
     containerRegistry.RegisterForNavigation <RouteEditorView>();
     ViewModelLocationProvider.Register <RouteEditorView, IRouteEditorViewModel>();
 }
示例#13
0
 public FooterModule(IRegionManager regionManager, IUnityContainer container)
 {
     this.regionManager = regionManager;
     //Im actually not sure if this is the right place to do this.. I couldn't find any advice on the internet
     //when I looked. I suspect this should go in initialise.
     ViewModelLocationProvider.Register(typeof(Footer).ToString(), () => container.Resolve <FooterViewModel>());
 }
示例#14
0
        private static void RegisterViewByAttribute(IContainerRegistry containerRegistry, RegisterForNavigationAttribute attr)
        {
            if (attr.ViewType is null)
            {
                throw new Exception($"Cannot auto register View. No ViewType was specified. Name: '{attr.Name}'. ViewModelType: '{attr.ViewModelType?.Name}'");
            }

            if (attr.RuntimePlatform != null && attr.RuntimePlatform.ToString() != Device.RuntimePlatform)
            {
                return;
            }

            var name = attr.Name;

            if (string.IsNullOrEmpty(name))
            {
                name = attr.ViewType.Name;
            }

            containerRegistry.RegisterForNavigation(attr.ViewType, name);

            if (attr.ViewModelType != null)
            {
                ViewModelLocationProvider.Register(attr.ViewType.Name, attr.ViewModelType);
            }
        }
示例#15
0
        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation <MainView>();

            ViewModelLocationProvider.Register <ToolMenusContainerView, ToolsMenusContainerViewModel>();
            ViewModelLocationProvider.Register <ToolboxesContainerView, ToolboxesContainerViewModel>();
        }
 public void BindFileBrowserModuleViewModels()
 {
     ViewModelLocationProvider.Register <FileBrowserControl, FileBrowserControlViewModel>();
     ViewModelLocationProvider.Register <FolderTreeControl, FolderTreeControlViewModel>();
     ViewModelLocationProvider.Register <FolderViewControl, FolderViewControlViewModel>();
     ViewModelLocationProvider.Register <FolderItemControl, FolderItemControlViewModel>();
 }
示例#17
0
        protected override void ConfigureViewModelLocator()
        {
            base.ConfigureViewModelLocator();
            AppVM appVM = new AppVM(Container.Resolve <IEventAggregator>());

            ViewModelLocationProvider.Register <MainWindow>(() => { return(appVM); });
        }
示例#18
0
        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            ViewModelLocationProvider.Register <MailGroup, MailGroupViewModel>();

            containerRegistry.RegisterForNavigation <MailList, MailListViewModel>();
            containerRegistry.RegisterSingleton <IMailService, MailService>();
        }
示例#19
0
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            ViewModelLocationProvider.Register(typeof(MainWindow).ToString(), typeof(MainWindowViewModel));
            ViewModelLocationProvider.Register(typeof(SplashScreenView).ToString(), typeof(SplashScreenViewModel));
            ViewModelLocationProvider.Register(typeof(StudyGridView).ToString(), typeof(StudyGridViewModel));
            ViewModelLocationProvider.Register(typeof(StudySearchView).ToString(), typeof(StudySearchViewModel));
            ViewModelLocationProvider.Register(typeof(StudyDetailView).ToString(), typeof(StudyDetailViewModel));
            ViewModelLocationProvider.Register(typeof(StudyEditorView).ToString(), typeof(StudyEditorViewModel));
            ViewModelLocationProvider.Register(typeof(EndpointDescriptorSelectorView).ToString(), typeof(EndpointDescriptorSelectorViewModel));


            containerRegistry.Register <IRegistryRepository, ClinicalTrialsRegistryRepository>("ClinicalTrials");
            containerRegistry.Register <IPublicationRepository, PubmedPublicationRepository>("Pubmed");
            containerRegistry.RegisterSingleton <object, MainLoader>();
            containerRegistry.RegisterSingleton <List <EndpointDescriptor>, List <EndpointDescriptor> >();
            containerRegistry.Register <IEndpointRepository, MySqlEndpointRepository>();

            containerRegistry.Register <object, StudySearchView>("StudySearchView");
            containerRegistry.Register <object, StudyGridView>("StudyGridView");
            containerRegistry.Register <object, ModelSelectionView>("ModelSelectionView");
            containerRegistry.Register <object, InterventionalStudyEditorView>("InterventionalStudyEditorView");
            containerRegistry.Register <object, ObservationalStudyEditorView>("ObservationalStudyEditorView");

            //containerRegistry.Register<object, StudyEditorView>("StudyGridView");
        }
示例#20
0
 public void RegisterTypes(IContainerRegistry containerRegistry)
 {
     containerRegistry.Register <ISettingsViewModel, SettingsViewModel>();
     containerRegistry.Register <SettingsNavigationCommand>();
     containerRegistry.RegisterForNavigation <SettingsView>();
     ViewModelLocationProvider.Register <SettingsView, ISettingsViewModel>();
 }
示例#21
0
 protected override void ConfigureViewModelLocator()
 {
     base.ConfigureViewModelLocator();
     ViewModelLocationProvider.Register <MainWindow>(() => new MainWindowViewModel(this.MainWindow));
     ViewModelLocationProvider.Register <WingcodeMsgDialog, WingcodeMsgDialogViewModel>();
     ViewModelLocationProvider.Register <WingcodeDialogBox, WingcodeDialogBoxViewModel>();
 }
示例#22
0
文件: App.xaml.cs 项目: astatsa/tds
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterInstance <ITdsApi>(RestService.For <ITdsApi>(
                                                             new System.Net.Http.HttpClient(new ApiMessageHandler(new HttpClientHandler(), () => SessionContext.Token))
            {
                BaseAddress = new Uri(Settings.ServerUrl),
                Timeout     = TimeSpan.FromMilliseconds(Settings.TimeoutMs),
            }));

            containerRegistry.RegisterDialog <RefuelDialog, RefuelDialogViewModel>();

            var container = containerRegistry.GetContainer();

            container.RegisterFactory <DbRepository>(
                c =>
            {
                var dbFolder = c.Resolve <IDbFolderService>();
                return(new DbRepository(dbFolder.GetDbPath("tds.db")));
            },
                FactoryLifetime.Singleton);
            containerRegistry.Register <RepeatFailedMethodService>();

            ViewModelLocationProvider.Register <LoginPage, LoginPageViewModel>();
            ViewModelLocationProvider.Register <OrderListPage, OrderListPageViewModel>();
            ViewModelLocationProvider.Register <OrderPage, OrderPageViewModel>();
            ViewModelLocationProvider.Register <RefuelDialog, RefuelDialogViewModel>();
        }
示例#23
0
 protected override void RegisterTypes(IContainerRegistry containerRegistry)
 {
     containerRegistry.Register <ICharacterCountService, CharacterCountService>();
     containerRegistry.Register <IMathService, MathService>();
     containerRegistry.Register <IMainWindowViewModel, MainWindowViewModel>();
     ViewModelLocationProvider.Register <MainWindow, MainWindowViewModel>();
 }
示例#24
0
        private void OnPluginInterfaceDialogRequested(object sender, DialogRequestedEventArgs e)
        {
            if (sender is IEltraNavigoPluginService pluginService)
            {
                var dialogView = pluginService.ResolveDialogView(e.ViewModel);

                if (dialogView != null)
                {
                    var viewModel      = e.ViewModel;
                    var dialogViewName = dialogView.GetType().Name;

                    if (!_containerRegistry.IsRegistered(dialogView.GetType()))
                    {
                        var viewType      = dialogView.GetType().ToString();
                        var viewModelType = e.ViewModel.GetType();

                        ViewModelLocationProvider.Register(viewType, viewModelType);

                        _containerRegistry.Register(typeof(object), dialogView.GetType(), dialogViewName);
                    }

                    ThreadHelper.RunOnMainThread(() =>
                    {
                        Action <IDialogResult> dialogResult = (r) => {
                            e.DialogResult = r;
                        };

                        _dialogService?.ShowDialog(dialogViewName, e.Parameters, dialogResult);
                    });
                }
            }
        }
        public static void Initialize(IContainerRegistry container, IContainerProvider provider)
        {
            container.Register <IDialogService, DialogService>();
            container.RegisterDialogWindow <DialogHost>();

            container.RegisterDialog <NewDialog, NewDialogViewModel>(Dialog.New.Name);
            container.RegisterDialog <SelectionDialog, SelectionDialogViewModel>(Dialog.Selection.Name);
            container.RegisterDialog <SaveDialog, SaveDialogViewModel>(Dialog.Save.Name);
            container.RegisterDialog <ConfirmationDialog, ConfirmationDialogViewModel>(Dialog.Confirmation.Name);
            container.RegisterDialog <PrintDialog, PrintDialogViewModel>(Dialog.Print.Name);
            container.RegisterDialog <AboutDialog, AboutDialogViewModel>(Dialog.About.Name);
            container.RegisterDialog <CharacterElementDialog, CharacterElementDialogViewModel>(Dialog.CharacterElementSelection.Name);
            container.RegisterDialog <ApplyTemplateDialog, ApplyTemplateDialogViewModel>(Dialog.ApplyTemplate.Name);

            ViewModelLocationProvider.Register <MainWindow>(() => provider.Resolve <MainWindowViewModel>());
            ViewModelLocationProvider.Register <MainMenu>(() => provider.Resolve <MainMenuViewModel>());
            ViewModelLocationProvider.Register <GameObjectEditor>(() => provider.Resolve <GameObjectEditorViewModel>());
            ViewModelLocationProvider.Register <GameObjectTree>(() => provider.Resolve <GameObjectTreeViewModel>());
            ViewModelLocationProvider.Register <AbilityEditToolbar>(() => provider.Resolve <AbilityEditToolbarViewModel>());

            ViewModelLocationProvider.Register <NewDialog>(() => provider.Resolve <NewDialogViewModel>());
            ViewModelLocationProvider.Register <SelectionDialog>(() => provider.Resolve <SelectionDialogViewModel>());
            ViewModelLocationProvider.Register <SaveDialog>(() => provider.Resolve <SaveDialogViewModel>());
            ViewModelLocationProvider.Register <ConfirmationDialog>(() => provider.Resolve <ConfirmationDialogViewModel>());
            ViewModelLocationProvider.Register <PrintDialog>(() => provider.Resolve <PrintDialogViewModel>());
            ViewModelLocationProvider.Register <AboutDialog>(() => provider.Resolve <AboutDialogViewModel>());
            ViewModelLocationProvider.Register <CharacterElementDialog>(() => provider.Resolve <CharacterElementDialogViewModel>());
            ViewModelLocationProvider.Register <ApplyTemplateDialog>(() => provider.Resolve <ApplyTemplateDialogViewModel>());

            ProxyDataLocator.Register <CharacterElementStorage>(() => provider.Resolve <CharacterElementStorageData>());
            ProxyDataLocator.Register <ApplyCharacterTemplate>(() => provider.Resolve <ApplyCharacterTemplateData>());
        }
示例#26
0
        public void Bind()
        {
            ViewModelLocationProvider.Register <MainWindow, MainWindowViewModel>();

            this.BindCountryBrowserModule();
            this.BindSettingsBrowserModule();
        }
示例#27
0
        protected override Task OnInitializeAsync(IActivatedEventArgs args)
        {
            TwitterClient.Instance.Initialize();
            ViewModelLocationProvider.Register(typeof(MainPage).ToString(), () => new MainPageViewModel(NavigationService));

            return(base.OnInitializeAsync(args));
        }
示例#28
0
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterSingleton(typeof(CameraProvider));
            containerRegistry.RegisterSingleton(typeof(PortProvider));

            ViewModelLocationProvider.Register <ShellWindow, MainViewModel>();
        }
示例#29
0
 public void RegisterTypes(IContainerRegistry containerRegistry)
 {
     containerRegistry.Register <IAircraftListViewModel, AircraftListViewModel>();
     containerRegistry.Register <ShowRemoveConfirmationDialogCommand>();
     containerRegistry.RegisterForNavigation <AircraftListView>();
     ViewModelLocationProvider.Register <AircraftListView, IAircraftListViewModel>();
 }
示例#30
0
        /// <inheritdoc/>
        protected override void ConfigureViewModelLocator()
        {
            base.ConfigureViewModelLocator();

            ViewModelLocationProvider.Register <Views.Timeline.VideoTimelineView, ViewModels.Timeline.VideoTimelineViewModel>();
            ViewModelLocationProvider.Register <VideoDetailsView, ViewModels.VideoDetailsViewModel>();
        }