public AboutPage() { InitializeComponent(); //var settingsViewModel = new SettingsViewModel(); //DataContext = settingsViewModel; DataContext = new AboutPageViewModel(); }
public static void Show(ApplicationInfo applicationInfo, params InfoPage[] visibleInfoPages) { var quoridorRulesPageViewModel = new QuoridorRulesPageViewModel(); var quoridorNotationPageViewModel = new QuoridorNotationPageViewModel(); var howToWriteABotPageViewModel = new HowToWriteABotPageViewModel(); var botVsBotInfoPageViewModel = new BotVsBotInfoPageViewModel(); var playerVsBotInfoPageViewModel = new PlayerVsBotInfoPageViewModel(); var replayViewerInfoPageViewModel = new ReplayViewerInfoPageViewModel(); var turnamentInfoPageViewModel = new TournamentInfoPageViewModel(); var aboutPageViewModel = new AboutPageViewModel(applicationInfo); var viewModels = new ObservableCollection <IPage>(); foreach (var visibleInfoPage in visibleInfoPages) { switch (visibleInfoPage) { case InfoPage.About: viewModels.Add(aboutPageViewModel); break; case InfoPage.BotVsBotApplicationInfo: viewModels.Add(botVsBotInfoPageViewModel); break; case InfoPage.HowToWriteABot: viewModels.Add(howToWriteABotPageViewModel); break; case InfoPage.PlayerVsBotApplicationInfo: viewModels.Add(playerVsBotInfoPageViewModel); break; case InfoPage.QuoridorNotation: viewModels.Add(quoridorNotationPageViewModel); break; case InfoPage.QuoridorRules: viewModels.Add(quoridorRulesPageViewModel); break; case InfoPage.ReplayViewerApplicationInfo: viewModels.Add(replayViewerInfoPageViewModel); break; case InfoPage.TournamentApplicationInfo: viewModels.Add(turnamentInfoPageViewModel); break; } } var infoWindowViewModel = new InfoWindowViewModel(viewModels); var infoWindow = new InfoWindow.InfoWindow { DataContext = infoWindowViewModel, Owner = Application.Current.MainWindow, Height = Application.Current.MainWindow.Height, Width = Application.Current.MainWindow.Width }; infoWindow.ShowDialog(); // cleanup quoridorRulesPageViewModel.Dispose(); quoridorNotationPageViewModel.Dispose(); howToWriteABotPageViewModel.Dispose(); botVsBotInfoPageViewModel.Dispose(); playerVsBotInfoPageViewModel.Dispose(); replayViewerInfoPageViewModel.Dispose(); turnamentInfoPageViewModel.Dispose(); aboutPageViewModel.Dispose(); infoWindowViewModel.Dispose(); }
public AboutShrinkHeaderPage() { InitializeComponent(); this.BindingContext = viewModel = new AboutPageViewModel(); MainScrollView.Scrolled += MainScrollView_Scrolled; }
public AboutPageView() { NavigationPage.SetHasNavigationBar(this, false); Padding = _padding; BackgroundColor = Color.FromHex(Theme.Current.AppBackgroundColor); BindingContext = new AboutPageViewModel(new PlatformServices()); createViews(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.About); var aboutPageViewModel = new AboutPageViewModel(this); aboutPageViewModel.AboutPageActivity(); }
protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.Parameter is AboutPageViewModel viewModel) { ViewModel = viewModel; } ViewModel.OnNavigatedTo(); }
public AboutSettingsPage() { this.InitializeComponent(); this.SetRequestedTheme(); this.viewModel = Ioc.Build <AboutPageViewModel>(); this.DataContext = this.viewModel; this.navigationService = Ioc.Resolve <INavigationService>(); }
public AboutPage() { if (WpfUtil.IsInDesignMode) { return; } this.Vm = new AboutPageViewModel(); this.DataContext = this.Vm; InitializeComponent(); }
public IActionResult Index() { var topLecturers = this.aboutService.GetTopLecturers <TopLectorerViewModel>(); var siteInfo = this.aboutService.GetAboutInfo(); var viewModel = new AboutPageViewModel { Lectorers = topLecturers, LearningCenterInfo = siteInfo }; return(this.View(viewModel)); }
public SettingsViewModel(ISettingsService settingsService, IDefaultValueProvider defaultValueProvider, IDialogService dialogService, ITrayProcessCommunicationService trayProcessCommunicationService, IThemeParserFactory themeParserFactory, ISystemFontService systemFontService, IFileSystemService fileSystemService, IStartupTaskService startupTaskService, IUpdateService updateService, IApplicationView applicationView) { About = new AboutPageViewModel(settingsService, updateService, applicationView); KeyBindings = new KeyBindingsPageViewModel(settingsService, dialogService, defaultValueProvider, trayProcessCommunicationService); General = new GeneralPageViewModel(settingsService, dialogService, defaultValueProvider, startupTaskService); Shell = new ProfilesPageViewModel(settingsService, dialogService, defaultValueProvider, fileSystemService); Terminal = new TerminalPageViewModel(settingsService, dialogService, defaultValueProvider, systemFontService); Themes = new ThemesPageViewModel(settingsService, dialogService, defaultValueProvider, themeParserFactory, fileSystemService); Mouse = new MousePageViewModel(settingsService, dialogService, defaultValueProvider); }
// 初始化所有页面 public static void InitPages() { // 创建各个子页面 PathProjectPage = new PathProjectPage(); RouteRecordPage = new RouteRecordPage(); SettingPage = new SettingPage(); AboutPage = new AboutPage(); // 创建各个子页面的ViewModel PathProjectPageViewModel = new PathProjectPageViewModel(); RouteRecordPageViewModel = new RouteRecordPageViewModel(); SettingPageViewModel = new SettingPageViewModel(); AboutPageViewModel = new AboutPageViewModel(); // 设置各个页面的视图模型 PathProjectPage.DataContext = PathProjectPageViewModel; RouteRecordPage.DataContext = RouteRecordPageViewModel; SettingPage.DataContext = SettingPageViewModel; AboutPage.DataContext = AboutPageViewModel; // 默认显示线路规划页面 CurrentPage = PathProjectPage; IsPathProjectPageChecked = true; }
public ActionResult About() { AboutPageViewModel model = new AboutPageViewModel(); return(View(model)); }
public AboutPage() { InitializeComponent(); BindingContext = new AboutPageViewModel(); }
public ActionResult Index(AboutPage currentPage) { var model = new AboutPageViewModel(currentPage); return(View(model)); }
public void BuildAndStart(StartupEventArgs startupEventArgs) { #if DEBUG var listener = new OnkoTePlaDebugListener(); Debug.Listeners.Add(listener); #endif AssureAppDataDirectoriesExist(); var dataCenterContainer = new DataCenterContainer(); // ConnectionService connectionServiceBuilder = new ConnectionServiceBuilder(dataCenterContainer); connectionService = connectionServiceBuilder.Build(); // Patient-Repository var patientPersistenceService = new XmlPatientDataStore(GlobalConstants.PatientPersistenceFile); patientRepository = new PatientRepository(patientPersistenceService, connectionService); patientRepository.LoadRepository(); // Config-Repository var configPersistenceService = new XmlConfigurationDataStore(GlobalConstants.ConfigPersistenceFile); configRepository = new ConfigurationRepository(configPersistenceService); configRepository.LoadRepository(); // LocalSettings-Repository var settingsPersistenceService = new LocalSettingsXmlPersistenceService(GlobalConstants.LocalServerSettingsPersistanceFile); localSettingsRepository = new LocalSettingsRepository(settingsPersistenceService); localSettingsRepository.LoadRepository(); // Event-Store var eventStreamPersistenceService = new XmlEventStreamPersistanceService(); var streamPersistenceService = new StreamPersistenceService(eventStreamPersistenceService, configRepository, GlobalConstants.EventHistoryBasePath, 500); var metaDataPersistenceService = new XmlPracticeMetaDataPersistanceService(GlobalConstants.MetaDataPersistanceFile); var metaDataService = new StreamMetaDataService(metaDataPersistenceService); eventStore = new EventStore(streamPersistenceService, metaDataService, connectionService); eventStore.LoadRepository(); // DataAndService var dataCenter = new DataCenter(configRepository, patientRepository, eventStore); dataCenterContainer.DataCenter = dataCenter; var backUpService = new BackupService(patientRepository, configRepository, eventStore, connectionService); backupScheduler = new BackupScheduler(backUpService); backupScheduler.Start(localSettingsRepository); // ViewModel-Variables var selectedPageVariable = new SharedState <MainPage>(MainPage.Overview); // sampleData-generators var patientNameGenerator = new PatientNameGenerator(); var appointmentGenerator = new AppointmentGenerator(configRepository, patientRepository, eventStore); // ViewModels var selectedPatientVariable = new SharedState <Patient>(null); var patientSelectorViewModel = new PatientSelectorViewModel(patientRepository, selectedPatientVariable, null); var overviewPageViewModel = new OverviewPageViewModel(connectionService); var connectionsPageViewModel = new ConnectionsPageViewModel(dataCenter, connectionService, selectedPageVariable); var userPageViewModel = new UserPageViewModel(dataCenter, selectedPageVariable); var licencePageViewModel = new LicencePageViewModel(); var infrastructurePageViewModel = new InfrastructurePageViewModel(dataCenter, selectedPageVariable, appointmentGenerator); var hoursOfOpeningPageViewModel = new HoursOfOpeningPageViewModel(dataCenter, selectedPageVariable); var therapyPlaceTypesPageViewModel = new TherapyPlaceTypesPageViewModel(dataCenter, selectedPageVariable, connectionService); var labelPageViewModel = new LabelPageViewModel(dataCenter, selectedPageVariable, connectionService); var patientsPageViewModel = new PatientsPageViewModel(patientSelectorViewModel, patientRepository, selectedPatientVariable, patientNameGenerator); var backupPageViewModel = new BackupPageViewModel(backUpService, backupScheduler, localSettingsRepository); var optionsPageViewModel = new OptionsPageViewModel(); var aboutPageViewModel = new AboutPageViewModel(); var mainWindowViewModel = new MainWindowViewModel(overviewPageViewModel, connectionsPageViewModel, userPageViewModel, licencePageViewModel, infrastructurePageViewModel, hoursOfOpeningPageViewModel, therapyPlaceTypesPageViewModel, labelPageViewModel, patientsPageViewModel, backupPageViewModel, optionsPageViewModel, aboutPageViewModel, selectedPageVariable); var mainWindow = new Visualization.MainWindow { DataContext = mainWindowViewModel }; mainWindow.Show(); #if DEBUG var debugOutputWindowViewModel = new DebugOutputWindowViewModel(listener); var debugWindow = new DebugOutputWindow { Owner = mainWindow, DataContext = debugOutputWindowViewModel }; debugWindow.Show(); #endif }
public void CreateViewModels(ViewModelFactory viewModelFactory) { _viewModel = viewModelFactory.CreateAboutViewModel(); }
public AboutAsPage() { this.viewModel = new AboutPageViewModel(this); InitializeComponent(); }
public AboutPage() { AboutPageVM = new AboutPageViewModel(); this.InitializeComponent(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); AssureAppDataDirectoriesExist(); /////////////////////////////////////////////////////////////////////////////////////////////////// //////// ////////// //////// Composition Root and Setup ////////// //////// ////////// /////////////////////////////////////////////////////////////////////////////////////////////////// var dataCenterContainer = new DataCenterContainer(); // ConnectionService var connectionServiceBuilder = new ConnectionServiceBuilder(dataCenterContainer); var connectionService = connectionServiceBuilder.Build(); // Patient-Repository var patientPersistenceService = new XmlPatientDataStore(GlobalConstants.PatientPersistenceFile); var patientRepository = new PatientRepository(patientPersistenceService, connectionService); patientRepository.LoadRepository(); // Config-Repository var configPersistenceService = new XmlConfigurationDataStore(GlobalConstants.ConfigPersistenceFile); var configRepository = new ConfigurationRepository(configPersistenceService); configRepository.LoadRepository(); // LocalSettings-Repository var settingsPersistenceService = new LocalSettingsXmlPersistenceService(GlobalConstants.LocalServerSettingsPersistanceFile); var localSettingsRepository = new LocalSettingsRepository(settingsPersistenceService); localSettingsRepository.LoadRepository(); // Event-Store var eventStreamPersistenceService = new XmlEventStreamPersistanceService(); var streamPersistenceService = new StreamPersistenceService(eventStreamPersistenceService, configRepository, GlobalConstants.EventHistoryBasePath, 500); var metaDataPersistenceService = new XmlPracticeMetaDataPersistanceService(GlobalConstants.MetaDataPersistanceFile); var metaDataService = new StreamMetaDataService(metaDataPersistenceService); var eventStore = new EventStore(streamPersistenceService, metaDataService, connectionService); eventStore.LoadRepository(); // DataAndService var dataCenter = new DataCenter(configRepository, patientRepository, eventStore); dataCenterContainer.DataCenter = dataCenter; var backUpService = new BackupService(patientRepository, configRepository, eventStore, connectionService); var backupScheduler = new BackupScheduler(backUpService); backupScheduler.Start(localSettingsRepository); // ViewModel-Variables var selectedPageVariable = new SharedState <MainPage>(MainPage.Overview); // sampleData-generators var patientNameGenerator = new PatientNameGenerator(); var appointmentGenerator = new AppointmentGenerator(configRepository, patientRepository, eventStore); // ViewModels var selectedPatientVariable = new SharedState <Patient>(null); var patientSelectorViewModel = new PatientSelectorViewModel(patientRepository, selectedPatientVariable); var overviewPageViewModel = new OverviewPageViewModel(connectionService); var connectionsPageViewModel = new ConnectionsPageViewModel(dataCenter, connectionService, selectedPageVariable); var userPageViewModel = new UserPageViewModel(dataCenter, selectedPageVariable); var licencePageViewModel = new LicencePageViewModel(); var infrastructurePageViewModel = new InfrastructurePageViewModel(dataCenter, selectedPageVariable, appointmentGenerator); var hoursOfOpeningPageViewModel = new HoursOfOpeningPageViewModel(dataCenter, selectedPageVariable); var therapyPlaceTypesPageViewModel = new TherapyPlaceTypesPageViewModel(dataCenter, selectedPageVariable, connectionService); var labelPageViewModel = new LabelPageViewModel(dataCenter, selectedPageVariable, connectionService); var patientsPageViewModel = new PatientsPageViewModel(patientSelectorViewModel, patientRepository, selectedPatientVariable, patientNameGenerator); var backupPageViewModel = new BackupPageViewModel(backUpService, backupScheduler, localSettingsRepository); var optionsPageViewModel = new OptionsPageViewModel(); var aboutPageViewModel = new AboutPageViewModel("0.1.0.0"); var mainWindowViewModel = new MainWindowViewModel(overviewPageViewModel, connectionsPageViewModel, userPageViewModel, licencePageViewModel, infrastructurePageViewModel, hoursOfOpeningPageViewModel, therapyPlaceTypesPageViewModel, labelPageViewModel, patientsPageViewModel, backupPageViewModel, optionsPageViewModel, aboutPageViewModel, selectedPageVariable); var mainWindow = new MainWindow { DataContext = mainWindowViewModel }; mainWindow.ShowDialog(); /////////////////////////////////////////////////////////////////////////////////////////////// //////// ////////// //////// Clean Up and store data after main Window was closed ////////// //////// ////////// /////////////////////////////////////////////////////////////////////////////////////////////// backupScheduler.Stop(); configRepository.PersistRepository(); patientRepository.PersistRepository(); eventStore.PersistRepository(); localSettingsRepository.PersistRepository(); connectionServiceBuilder.DisposeConnectionService(connectionService); }
public AboutPage() { this.InitializeComponent(); DataContext = new AboutPageViewModel(); }