public StudentVM() { book = AppVM.selectedBook; StudentVMMethods = new CommandsStudentVMMethods(); appVMMethods = new CommandsAppVMMethods(); using (AppContext db = new AppContext()) { Students = new ObservableCollection <Student>(db.Students.ToList()); } }
public BookVM() { if (AppVM.selectedBook == null) { sbook = book = new Book { InvNumber = 0, BookName = "", Authors = "", Year = 0, EntranceDate = new DateTime(1, 1, 1) }; srealBook = realBook = null; } else { realBook = AppVM.selectedBook; book = (Book)AppVM.selectedBook.Clone(); } appVMMethods = new CommandsAppVMMethods(); bookVMMethods = new CommandsBookVMMethods(); }