private void AddToRoutine(Type taskType) { var routineViewModel = new RoutineViewModel(taskType, _game, _repo, _executioner, _settings, _queue); routineViewModel.PropertyChanged += RoutineViewModelOnPropertyChanged; RoutineItems.Add(routineViewModel); AddAllToQueue.RaiseCanExecuteChanged(); }
private void RoutineViewModelOnPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == nameof(RoutineViewModel.IsChecked)) { RaisePropertyChanged(nameof(CheckAll)); AddAllToQueue.RaiseCanExecuteChanged(); _settings.RoutineItemsState = RoutineItems.Select(x => x.IsChecked.ToString()).ToArray(); } }
private void AddAll() { foreach (var t in RoutineItems.Where(x => x.IsChecked)) { t.AddToQueue(); } AddAllToQueue.RaiseCanExecuteChanged(); }