Example #1
0
 /// <summary>
 /// Deletes a book if the user confirms the choice and/or removes it from
 /// the recent reads listview if so chosen.
 /// </summary>
 /// <param name="command"></param>
 private async void CommandInvokedHandler(IUICommand command)
 {
     if (command.Label != "Yes")
     {
         return;
     }
     if (_ourBook == null)
     {
         return;
     }
     if (!LibrarySource.IsDataLoaded)
     {
         await RetrieveLibrary();
     }
     if (LibrarySource.RecentReads.Contains(_ourBook))
     {
         _ourBook.CurrentPage    = 0;
         _ourBook.CurrentChapter = 0;
         _ourBook.IsStarted      = false;
         _ourBook.IsCompleted    = false;
         LibrarySource.RecentReads.Remove(_ourBook);
     }
     if (!_isRecentReads)
     {
         await LibrarySource.RemoveBook(_ourBook);
     }
 }