public EditUserViewModel(MainWindowViewModel MainWindowVM)
        {
            this.MainWindowVM = MainWindowVM;

            var ui = DB.getUserInfo(MainWindowVM.user.Id);

            _Image    = EditCardViewModel.ToImage(ui.ImageBytes);
            _Password = MainWindowVM.user.Password;
            _NickName = MainWindowVM.user.NickName;
            _Fio      = ui.Fio;
            _Mail     = ui.Mail;
            _BirthDay = ui.BirthDate;
        }
示例#2
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);
        }
示例#3
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);
        }