public NewFlashcardViewModel( MainWindowViewModel mainWindowViewModel, SectionDto section, ICreateFlashcardService createFlashcardService, RelayCommand.Factory relayCommand) { _mainWindowViewModel = mainWindowViewModel; _createFlashcardService = createFlashcardService; _section = section; CreateFlashcardCommand = relayCommand(CreateFlashcard, CanCreateFlashcard); CancelCommand = relayCommand(BackToTopics); }
public EditTopicViewModel( MainWindowViewModel mainWindowViewModel, int topicId, RelayCommand.Factory relayCommand, RelayCommand <string> .Factory relayCommandString, RelayCommand <int?> .Factory relayCommandInt, RelayCommand <SectionDto> .Factory relayCommandSectionDto, RelayCommand <Flashcard> .Factory relayCommandFlashcard, RelayCommand <QueryRoundOptions> .Factory relayCommandQueryRoundOptions, ICreateSectionService createSectionService, IDeleteSectionService deleteSectionService, IDeleteFlashcardService deleteFlashcardService, IListSectionsService listSectionsService ) { _mainWindowViewModel = mainWindowViewModel; _topicId = topicId; _createSectionService = createSectionService; _deleteSectionService = deleteSectionService; _deleteFlashcardService = deleteFlashcardService; _listSectionsService = listSectionsService; BackToTopicsCommand = relayCommand(BackToTopics); CreateSectionCommand = relayCommandString(CreateSection); DeleteSectionCommand = relayCommandSectionDto(DeleteSection); DeleteFlashcardCommand = relayCommandFlashcard(DeleteFlashcard); NewFlashcardCommand = relayCommandInt(NewFlashcard, CanCreateFlashcard); StartQueryRoundCommand = relayCommandQueryRoundOptions(StartQueryRound, CanStartQueryRound); var topicList = _listSectionsService.ListSections(_topicId); Sections = new ObservableCollection <SectionDto>(topicList); QueryRoundOptions = new QueryRoundOptions { NumberOfQueries = 10, Stage = 1, }; }