コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }