public StartVM() { NavigateToLoginCommand = new RelayCommand(() => { ViewNavigator.NavigateTo(new LoginVM()); }); }
internal void DeleteSongsFromDisc(IReadOnlyCollection <SongModel> songs) { if (ViewNavigator.ShowDeleteDiscSongsView(songs)) { LoadSongs(); } }
public SettingsVM() { WindowTitle = "Настройки"; Label = Properties.Settings.Default.Title; EndDate = Properties.Settings.Default.EndDate; OkClick = new RelayCommand(() => ViewNavigator.CloseLastView()); GoBackClick = new RelayCommand(() => ViewNavigator.CloseLastView(false)); CloseClick = new RelayCommand(() => ViewNavigator.CloseWindow()); }
public ShellViewModel(LoginViewModel loginVM, MenuViewModel menuVM, ViewNavigator viewNawigator) { _loginVM = loginVM; _menuVM = menuVM; _viewNavigator = viewNawigator; _viewNavigator.SetNavigator(Navigate); _viewNavigator.AddDirections(Direction.LogIn, _loginVM); _viewNavigator.AddDirections(Direction.Menu, _menuVM); Navigate(_loginVM); }
public MainViewModel() { _navigator = new ViewNavigator(nameof(TestView)); Messenger.Default.Register <NavigationMessage>(this, (message) => { _navigator.ChangeView(message.View); RaisePropertyChanged(() => CurrentView); }); RaisePropertyChanged(() => CurrentView); }
public Question1VM() { NavigateTo21Command = new RelayCommand(() => { ViewNavigator.NavigateTo(new Question21VM()); }); NavigateTo22Command = new RelayCommand(() => { ViewNavigator.NavigateTo(new Question22VM()); }); NavigateTo23Command = new RelayCommand(() => { ViewNavigator.NavigateTo(new Question23VM()); }); }
public Question35VM() { NavigateToJavaScriptCommand = new RelayCommand(() => { ViewNavigator.NavigateTo(new JavaScriptVM()); }); NavigateToTypeScriptCommand = new RelayCommand(() => { ViewNavigator.NavigateTo(new TypeScriptVM()); }); GoBackCommand = new RelayCommand(() => { ViewNavigator.CloseLastView(); }); }
public Question32VM() { NavigateToCSharpCommand = new RelayCommand(() => { ViewNavigator.NavigateTo(new CSharpVM()); }); NavigateToCPlusPlusCommand = new RelayCommand(() => { ViewNavigator.NavigateTo(new CPlusPlusVM()); }); GoBackCommand = new RelayCommand(() => { ViewNavigator.CloseLastView(); }); }
public Question34VM() { NavigateToPythonCommand = new RelayCommand(() => { ViewNavigator.NavigateTo(new PythonVM()); }); NavigateToPHPCommand = new RelayCommand(() => { ViewNavigator.NavigateTo(new PHPVM()); }); GoBackCommand = new RelayCommand(() => { ViewNavigator.CloseLastView(); }); }
public Question21VM() { NavigateTo31Command = new RelayCommand(() => { ViewNavigator.NavigateTo(new Question31VM()); }); NavigateTo32Command = new RelayCommand(() => { ViewNavigator.NavigateTo(new Question32VM()); }); GoBackCommand = new RelayCommand(() => { ViewNavigator.CloseLastView(); }); }
public Question23VM() { NavigateTo35Command = new RelayCommand(() => { ViewNavigator.NavigateTo(new Question35VM()); }); NavigateTo36Command = new RelayCommand(() => { ViewNavigator.NavigateTo(new Question36VM()); }); GoBackCommand = new RelayCommand(() => { ViewNavigator.CloseLastView(); }); }
public Question22VM() { NavigateTo33Command = new RelayCommand(() => { ViewNavigator.NavigateTo(new Question33VM()); }); NavigateTo34Command = new RelayCommand(() => { ViewNavigator.NavigateTo(new Question34VM()); }); GoBackCommand = new RelayCommand(() => { ViewNavigator.CloseLastView(); }); }
public Question33VM() { NavigateToAssemblerCommand = new RelayCommand(() => { ViewNavigator.NavigateTo(new AssemblerVM()); }); NavigateToCCommand = new RelayCommand(() => { ViewNavigator.NavigateTo(new CVM()); }); GoBackCommand = new RelayCommand(() => { ViewNavigator.CloseLastView(); }); }
public Question36VM() { NavigateTo1CCommand = new RelayCommand(() => { ViewNavigator.NavigateTo(new OneSVM()); }); NavigateToGoCommand = new RelayCommand(() => { ViewNavigator.NavigateTo(new GoVM()); }); GoBackCommand = new RelayCommand(() => { ViewNavigator.CloseLastView(); }); }
public Question31VM() { NavigateToJavaCommand = new RelayCommand(() => { ViewNavigator.NavigateTo(new JavaVM()); }); NavigateToKotlinCommand = new RelayCommand(() => { ViewNavigator.NavigateTo(new KotlinVM()); }); GoBackCommand = new RelayCommand(() => { ViewNavigator.CloseLastView(); }); }
protected override void OnStartup(StartupEventArgs e) { TrackingDataContext trackingDataContext = new TrackingDataContext(); MouseTracker mouseTracker = new MouseTracker(); KeyboardTracker keyboardTracker = new KeyboardTracker(); //Set timer to record activity data every second DispatcherTimer timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(1000) }; //Start tracking productivity and logging it timer.Tick += (o, e) => { var newTrackingRecord = new TrackingRecord { Active = false, ProcessName = ProcessTracker.GetActiveProcessName(), Timestamp = DateTime.Now }; if (mouseTracker.HasMouseMoved() || keyboardTracker.GetTimeElapsedSinceLastKeyPress() < timer.Interval.TotalMilliseconds) { newTrackingRecord.Active = true; trackingDataContext.Add(newTrackingRecord); } else { trackingDataContext.Add(newTrackingRecord); } trackingDataContext.SaveChanges(); }; timer.IsEnabled = true; //Code for setting up MVVM ViewNavigator viewNavigator = new ViewNavigator(); MainViewModel defaultViewModel = new MainViewModel(viewNavigator); viewNavigator.CurrentViewModel = defaultViewModel; Window window = new MainWindow(); window.DataContext = defaultViewModel; window.Show(); base.OnStartup(e); }
public CountDownVM() { WindowTitle = Properties.Settings.Default.Title; EndDate = Properties.Settings.Default.EndDate; var timer = new DispatcherTimer(); timer.Tick += timer_Tick; timer.Interval = new TimeSpan(500000); timer.Start(); CloseClick = new RelayCommand(() => ViewNavigator.CloseWindow()); SettingsClick = new RelayCommand(() => ViewNavigator.NavigateTo(new SettingsVM(), null, viewModel => { Properties.Settings.Default.Title = WindowTitle = viewModel.Label; Properties.Settings.Default.EndDate = EndDate = viewModel.EndDate; })); }
private void InitializeProperties() { IValidateIfInterfaceIsImplemented validator = new ViewModel.Validators.InterfaceImplementValidator(); Navigator = new ViewNavigator(validator, new PatientsPage()); // TODO: Dodać pozostałe Page TypeProvider = new ViewModel.DataProvider.NavigationPageTypeProvider(validator, new List <Type> { typeof(PatientsPage), typeof(DoctorsPage), typeof(AdmissionsPage), typeof(DiagnosesPage), typeof(RoomsPage), typeof(SurgeriesPage), typeof(NewAdmissionPage), }); Navigator.SetParameter(new Action(() => Navigator.ChangeFrame(typeof(NewAdmissionPage), mainFrame))); Type pageType = TypeProvider.GetTypeFromString("AdmissionsPage"); Navigator.ChangeFrame(pageType, mainFrame); Navigator.RemoveParameters(); }
private void InitializeProperties() { IValidateIfInterfaceIsImplemented validator = new Validators.Validator(); //mainFrame.Content = new AdmissionsPage(); Navigator = new ViewNavigator(validator, /*mainFrame.Content as IPageNavigateable*/ new AdmissionsPage(), controler); //Navigator.SetParameter(controler); TypeProvider = new DataProviders.NavigationPageTypeProvider(validator, new List <Type> { typeof(PatientsPage), typeof(AdmissionsPage), typeof(DoctorsPage), }); Type pageType = TypeProvider.GetTypeFromString("AdmissionsPage"); Navigator.ChangeFrame(pageType, mainFrame); /*Type type = typeof(Model.Patient); * type.In*/ }
public BaseLanguageVM() { NavigateTo1Command = new RelayCommand(() => { ViewNavigator.NavigateTo(new Question1VM()); }); NavigateToStartCommand = new RelayCommand(() => { var user = App.User; var result = $"{user.FirstName} {user.LastName} {user.DateOfBirth} {user.Language}"; var sb = new StringBuilder(); sb.AppendLine(result); File.AppendAllText("Users", sb.ToString()); ViewNavigator.NavigateTo(new StartVM()); }); }
public SettingsPageViewModel(ViewNavigator navigator) : base(navigator) { UpdateViewCommand = new UpdateViewCommand(Navigator); }
private void GoToOtherView() { ViewNavigator.Navigate(nameof(TestViewOther)); }
public ViewModelBase(ViewNavigator navigator) { Navigator = navigator; }
public LoginViewModel(ViewNavigator viewNavigator) { _viewNavigator = viewNavigator; }
public MenuViewModel(ViewNavigator viewNavigator) { _viewNavigator = viewNavigator; }