コード例 #1
0
        public MainWindowViewModel()
        {
            exerciseService = new ExerciseService("ExercisesDbConnection");
            Sections        = mapperDTOToPresent.Map <ObservableCollection <CheckedListExerciseItem> >(exerciseService.GetAll());

            timer          = new DispatcherTimer();
            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Tick    += new EventHandler(timer_Tick);
        }
コード例 #2
0
 private void UpdateInfo()
 {
     exerciseService = new ExerciseService("ExercisesDbConnection");
     Sections        = mapperDTOToPresent.Map <ObservableCollection <CheckedListExerciseItem> >(exerciseService.GetAll());
     timeLeft        = selectedInterval;
     OnPropertyChanged("TimeLeft");
     if (_shouldStartLoop)
     {
         _isTimerStarted = true;
         StopTimerCommand.RaiseCanExecuteChanged();
         StartTimerCommand.RaiseCanExecuteChanged();
         timer.Start();
     }
 }