public void EditBook_OnClick(object sender, RoutedEventArgs e, Book book) { EditBook editBook = new EditBook(book); Content.Children.Clear(); Content.Children.Add(editBook); MenuToggleButton.IsChecked = true; MenuToggleButton.IsHitTestVisible = true; ToolbarName.Text = book.Name; AddButton.Visibility = Visibility.Hidden; }
public void ViewBook(object sender, RoutedEventArgs e, Book book) { EditBook editBook = new EditBook(book); Content.Children.Clear(); Content.Children.Add(editBook); MenuToggleButton.IsChecked = true; MenuToggleButton.IsHitTestVisible = true; ToolbarName.Text = book.Name; editBook.CoverImage.IsReadOnly = true; editBook.Name.IsReadOnly = true; editBook.Description.IsReadOnly = true; editBook.Status.IsEnabled = false; editBook.Author.IsReadOnly = true; editBook.Date.IsEnabled = false; editBook.PageCount.IsReadOnly = true; editBook.BrowseImage.Visibility = Visibility.Hidden; editBook.AddButton.Visibility = Visibility.Hidden; editBook.CancelButton.Visibility = Visibility.Hidden; AddButton.Visibility = Visibility.Hidden; }
//Update Book -------------------- public void updateBookToolStripMenuItem_Click(object sender, EventArgs e) { if (editBook == null) { if(catalog != null) editBook = new EditBook(this, catalog.editIsbn); else editBook = new EditBook(this, null); editBook.MdiParent = this; editBook.Show(); } else { editBook.Activate(); } }