async public void removebook(object s, EventArgs args) { if (await DisplayAlert("Remove Book", "Are you sure want to remove this book from the library?", "Yes", "No")) { _bookdb.DeleteBook(book.Id); NavigationPage navPage = (NavigationPage)Application.Current.MainPage; IReadOnlyList <Page> navStack = navPage.Navigation.NavigationStack; int lastIndex = navStack.Count - 2; BookListPage bookListPage = navStack[lastIndex] as BookListPage; bookListPage.RemoveBook(book); // await DisplayAlert("Book Removed!", "Book has been removed from your library.", "OK"); await Navigation.PopAsync(); } }
public void DeleteBook(Book book) { BookDB.DeleteBook(book); }