Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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();
            }
        }