/// <summary> /// 加入书架 /// </summary> private void Join_Click(object sender, RoutedEventArgs e) { DataFetch.BookAdd(book); Join.Background = Brushes.DarkTurquoise; Join.Content = "已加入"; Join.IsEnabled = false; }
/// <summary> /// 加入书架 /// </summary> private void JoinBookshelves_Click(object sender, RoutedEventArgs e) { Book book = SearchList.SelectedItem as Book; if (book != null && book is Book) { if (DataFetch.BookAdd(book)) { new Tips("添加成功!").Show(); //获取所有书籍 this.DataContext = DataFetch.GetBooks(); } } }