public void ConfgureViewModel() { _vocabs = _vocabularyParserService.GetRandomizedVocabDictionary(_chapterPath); _selGermanVocabGroup = GetGermanVocabGroup(_routine); _selEnglishVocabGroup = GetEnglishVocabGroup(_routine); this.OutputLabel = _selGermanVocabGroup.ToString(); this.StatsTotalVocabs = _vocabs.Count; }
private async Task NextVocab() { string input = this.InputEntry; input = input.Trim(); InputState inputState = this.CheckInput(input); switch (inputState) { case InputState.NullOrEmpty: bool isSkipping = await _pageService.DisplayAlert(" Status", " Your input is empty! \n Do you want to skip?", "YES", "NO"); if (!isSkipping) { return; } await _pageService.DisplayAlert(" Status", $" The correct vocab should be: \n\n {_selEnglishVocabGroup.ToString()}", "OK"); this.StatsIncorrectVocabs++; _wrongVocabs.Add(new Vocabulary(_selEnglishVocabGroup.ToString(), _selGermanVocabGroup.ToString())); break; case InputState.Correct: await _pageService.DisplayAlert(" Status", " The input is correct!", "ok"); this.StatsCorrectVocabs++; break; case InputState.Incorrect: await _pageService.DisplayAlert(" Status", $" The input was wrong! \n It should be: \n\n {_selEnglishVocabGroup.ToString()}", "OK"); this.StatsIncorrectVocabs++; _wrongVocabs.Add(new Vocabulary(_selEnglishVocabGroup.ToString(), _selGermanVocabGroup.ToString())); break; } await this.SelectNextVocabs(); this.OutputLabel = _selGermanVocabGroup.ToString(); }