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; }
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); }