public ExerciseEditViewModel(IDialogViewService dialogService) { this.dialogService = dialogService ?? throw new ArgumentNullException("Dialog service must be provided."); SaveCommand = new RelayCommand(() => Save(), () => !this.HasErrors); CancelCommand = new RelayCommand(() => Cancel(), () => true); DeleteFilesCommand = new RelayCommand(() => DeleteFiles(), () => true); OpenFileCommand = new RelayCommand(() => OpenFile(), () => true); }
public PracticeRoutineManagementViewModel(IPracticeRoutineService practiceRoutineService, IDialogViewService dialogService) { this.practiceRoutineService = practiceRoutineService ?? throw new ArgumentNullException("Service must be provided."); this.dialogService = dialogService ?? throw new ArgumentNullException("Dialog service must be provided."); PracticeCommand = new RelayCommand(Practice, () => SelectedPracticeRoutine != null); AddPracticeRoutineCommand = new RelayCommand(AddPracticeRoutine, () => true); DeletePracticeRoutineCommand = new RelayCommand(DeletePracticeRoutine, () => SelectedPracticeRoutine != null); EditPracticeRoutineCommand = new RelayCommand(EditPracticeRoutine, () => SelectedPracticeRoutine != null); }
public PracticeRoutineEditViewModel(IDialogViewService dialogService) { this.dialogService = dialogService ?? throw new ArgumentNullException("Dialog service must be provided."); SaveCommand = new RelayCommand(() => Save(), () => !this.HasErrors); CancelCommand = new RelayCommand(() => Cancel(), () => true); AddTimeSlotCommand = new RelayCommand(() => AddTimeSlot(), () => true); AddExerciseCommand = new RelayCommand(() => AddExercise(), () => CanAddExercise()); DeleteCommand = new RelayCommand(() => Delete(), () => CanDeleteExercise()); SelectedItemChangedCommand = new RelayCommand <ViewModelBase>(c => SelectedItem = c); }
public ExerciseManagementViewModel(IExerciseService exerciseService, IDialogViewService dialogService) { this.exerciseService = exerciseService ?? throw new ArgumentNullException("Service must be provided."); this.dialogService = dialogService ?? throw new ArgumentNullException("Dialog service must be provided."); AddExerciseCommand = new RelayCommand(AddExercise, () => true); DeleteExerciseCommand = new RelayCommand(DeleteExercise, () => SelectedExercise != null); EditExerciseCommand = new RelayCommand(EditExercise, () => SelectedExercise != null); SelectExerciseCommand = new RelayCommand(SelectExercise, () => SelectedExercise != null); FindCommand = new RelayCommand(Find, true); PracticeExerciseCommand = new RelayCommand(() => PracticeExercise(), () => true); }
public ExerciseSelectionViewModel(IExerciseService exerciseService, IDialogViewService dialogService) : base(exerciseService, dialogService) { OkCommand = new RelayCommand(() => Save(), () => true); CancelCommand = new RelayCommand(() => Cancel(), () => true); }