private void NewButton_Click(object sender, RoutedEventArgs e) { var detailWindow = new BookDetailWindow(); if (detailWindow.ShowDialog() != true) { return; } _ctx.Books.Add(detailWindow.Model); _ctx.SaveChanges(); LoadBooks(); }
private void UpdateButton_Click(object sender, RoutedEventArgs e) { var toUpdate = BooksGrid.SelectedItem as BookRowVM; if (toUpdate == null) { return; } var detailWindow = new BookDetailWindow(toUpdate.Id); if (detailWindow.ShowDialog() == true) { LoadBooks(); } }