コード例 #1
0
 private void FügeBuchHinzu(object parameter)
 {
     if (parameter is Book book)
     {
         var result = FavoriteBooksManager.AddFavoriteBook(book);
         if (result.success)
         {
             MessageBox.Show($"Buch {book.volumeInfo.title} wurde hinzugefügt!");
         }
         else
         {
             MessageBox.Show(result.errorString);
         }
     }
 }
コード例 #2
0
 public FavoritePageVM()
 {
     FavoriteBooks         = new ObservableCollection <Book>(FavoriteBooksManager.FavoriteBooks);
     AddFavoriteCommand    = new DelegateCommand(param => FavoriteBooksManager.AddFavoriteBook(param as Book));
     RemoveFavoriteCommand = new DelegateCommand(param => FavoriteBooksManager.RemoveFavoriteBook(param as Book));
 }