Example #1
0
 public CreateSectionService(
     FlashcardsDbContext dbContext,
     RunnerWriteDb <SectionDto, Section> .Factory runner,
     ICreateSectionAction action,
     IListSectionsService listSectionsService)
 {
     _runner = runner(action);
     _listSectionsService = listSectionsService;
 }
Example #2
0
        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,
            };
        }