public WorkoutDetailViewModel(IEventAggregator eventAggregator, IMessageDialogService messageDialogService, IWorkoutRepository workoutRepository, IExerciseSetupRepository exerciseSetupRepository, IExerciseLookupDataService exerciseLookupDataService ) : base(eventAggregator, messageDialogService) { _workoutRepository = workoutRepository; _exerciseSetupRepository = exerciseSetupRepository; _exerciseLookupDataService = exerciseLookupDataService; eventAggregator.GetEvent <AfterDetailSavedEvent>().Subscribe(AfterDetailSaved); eventAggregator.GetEvent <AfterDetailDeletedEvent>().Subscribe(AfterDetailDeleted); AddedClients = new ObservableCollection <Client>(); AvailableClients = new ObservableCollection <Client>(); Exercises = new ObservableCollection <LookupItem>(); ExerciseSetups = new ObservableCollection <ExerciseSetupWrapper>(); AddToExerciseSetups = new DelegateCommand(OnAddToExerciseSetupsExecute, OnAddToExerciseSetupsCanExecute); AddClientCommand = new DelegateCommand(OnAddClientExecute, OnAddClientCanExecute); RemoveClientCommand = new DelegateCommand(OnRemoveClientExecute, OnRemoveClientCanExecute); AddExerciseSetupCommand = new DelegateCommand(OnAddExerciseSetup); RemoveExerciseSetupCommand = new DelegateCommand(OnRemoveExerciseSetupExecute, OnRemoveExerciseSetupCanExecute); MoveUp = new DelegateCommand(MoveUpExecute, MoveUpCanExecute); MoveDown = new DelegateCommand(MoveDownExecute, MoveDownCanExecute); }
public NavigationViewModel(IClientLookupDataService clientLookupService, IWorkoutLookupDataService workoutLookupService, IExerciseLookupDataService exerciseLookupDataService, IEventAggregator eventAggregator) { _clientLookupService = clientLookupService; _workoutLookupService = workoutLookupService; _exerciseLookupDataService = exerciseLookupDataService; _eventAggregator = eventAggregator; Clients = new ObservableCollection <NavigationItemViewModel>(); Workouts = new ObservableCollection <NavigationItemViewModel>(); Exercises = new ObservableCollection <NavigationItemViewModel>(); _eventAggregator.GetEvent <AfterDetailSavedEvent>().Subscribe(AfterDetailSaved); _eventAggregator.GetEvent <AfterDetailDeletedEvent>().Subscribe(AfterDetailDeleted); }