public TrainingCardViewModel(Deck deck, MainWindowViewModel mainWinVM) { Deck = deck; this.mainWinVM = mainWinVM; CurrentCard = DB.getTrainCard(deck.Id); QuestionText = DB.getMedia(CurrentCard.QuestionMediaId).Text; QuestionImage = EditCardViewModel.ToImage(DB.getMedia(CurrentCard.QuestionMediaId).Image); AnswearText = DB.getMedia(CurrentCard.AnswearMediaId).Text; AnswearImage = EditCardViewModel.ToImage(DB.getMedia(CurrentCard.AnswearMediaId).Image); Footer = new HidenAnswerPage(this); }
private void SetQuality(MemoryzationQuality quality) { DB.changeMemoryzationCategory(CurrentCard, quality); CurrentCard.lastAnswearTime = DateTime.Now; CurrentCard = DB.getTrainCard(Deck.Id); if (CurrentCard == null) { EndTraining.Execute(""); } else { QuestionText = DB.getMedia(CurrentCard.QuestionMediaId).Text; QuestionImage = EditCardViewModel.ToImage(DB.getMedia(CurrentCard.QuestionMediaId).Image); AnswearText = DB.getMedia(CurrentCard.AnswearMediaId).Text; AnswearImage = EditCardViewModel.ToImage(DB.getMedia(CurrentCard.AnswearMediaId).Image); } Footer = new HidenAnswerPage(this); }