Exemplo n.º 1
0
 public StartVM()
 {
     NavigateToLoginCommand = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new LoginVM());
     });
 }
Exemplo n.º 2
0
 internal void DeleteSongsFromDisc(IReadOnlyCollection <SongModel> songs)
 {
     if (ViewNavigator.ShowDeleteDiscSongsView(songs))
     {
         LoadSongs();
     }
 }
Exemplo n.º 3
0
        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());
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        public MainViewModel()
        {
            _navigator = new ViewNavigator(nameof(TestView));

            Messenger.Default.Register <NavigationMessage>(this, (message) =>
            {
                _navigator.ChangeView(message.View);
                RaisePropertyChanged(() => CurrentView);
            });

            RaisePropertyChanged(() => CurrentView);
        }
Exemplo n.º 6
0
 public Question1VM()
 {
     NavigateTo21Command = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new Question21VM());
     });
     NavigateTo22Command = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new Question22VM());
     });
     NavigateTo23Command = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new Question23VM());
     });
 }
Exemplo n.º 7
0
 public Question35VM()
 {
     NavigateToJavaScriptCommand = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new JavaScriptVM());
     });
     NavigateToTypeScriptCommand = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new TypeScriptVM());
     });
     GoBackCommand = new RelayCommand(() =>
     {
         ViewNavigator.CloseLastView();
     });
 }
Exemplo n.º 8
0
 public Question32VM()
 {
     NavigateToCSharpCommand = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new CSharpVM());
     });
     NavigateToCPlusPlusCommand = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new CPlusPlusVM());
     });
     GoBackCommand = new RelayCommand(() =>
     {
         ViewNavigator.CloseLastView();
     });
 }
Exemplo n.º 9
0
 public Question34VM()
 {
     NavigateToPythonCommand = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new PythonVM());
     });
     NavigateToPHPCommand = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new PHPVM());
     });
     GoBackCommand = new RelayCommand(() =>
     {
         ViewNavigator.CloseLastView();
     });
 }
Exemplo n.º 10
0
 public Question21VM()
 {
     NavigateTo31Command = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new Question31VM());
     });
     NavigateTo32Command = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new Question32VM());
     });
     GoBackCommand = new RelayCommand(() =>
     {
         ViewNavigator.CloseLastView();
     });
 }
Exemplo n.º 11
0
 public Question23VM()
 {
     NavigateTo35Command = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new Question35VM());
     });
     NavigateTo36Command = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new Question36VM());
     });
     GoBackCommand = new RelayCommand(() =>
     {
         ViewNavigator.CloseLastView();
     });
 }
Exemplo n.º 12
0
 public Question22VM()
 {
     NavigateTo33Command = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new Question33VM());
     });
     NavigateTo34Command = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new Question34VM());
     });
     GoBackCommand = new RelayCommand(() =>
     {
         ViewNavigator.CloseLastView();
     });
 }
Exemplo n.º 13
0
 public Question33VM()
 {
     NavigateToAssemblerCommand = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new AssemblerVM());
     });
     NavigateToCCommand = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new CVM());
     });
     GoBackCommand = new RelayCommand(() =>
     {
         ViewNavigator.CloseLastView();
     });
 }
Exemplo n.º 14
0
 public Question36VM()
 {
     NavigateTo1CCommand = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new OneSVM());
     });
     NavigateToGoCommand = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new GoVM());
     });
     GoBackCommand = new RelayCommand(() =>
     {
         ViewNavigator.CloseLastView();
     });
 }
Exemplo n.º 15
0
 public Question31VM()
 {
     NavigateToJavaCommand = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new JavaVM());
     });
     NavigateToKotlinCommand = new RelayCommand(() =>
     {
         ViewNavigator.NavigateTo(new KotlinVM());
     });
     GoBackCommand = new RelayCommand(() =>
     {
         ViewNavigator.CloseLastView();
     });
 }
Exemplo n.º 16
0
        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);
        }
Exemplo n.º 17
0
        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();
        }
Exemplo n.º 19
0
        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*/
        }
Exemplo n.º 20
0
        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);
 }
Exemplo n.º 22
0
 private void GoToOtherView()
 {
     ViewNavigator.Navigate(nameof(TestViewOther));
 }
Exemplo n.º 23
0
 public ViewModelBase(ViewNavigator navigator)
 {
     Navigator = navigator;
 }
Exemplo n.º 24
0
 public LoginViewModel(ViewNavigator viewNavigator)
 {
     _viewNavigator = viewNavigator;
 }
Exemplo n.º 25
0
 public MenuViewModel(ViewNavigator viewNavigator)
 {
     _viewNavigator = viewNavigator;
 }