コード例 #1
0
        async void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
        {
            if (!LibrarySource.IsDataLoaded)
            {
                await LibrarySource.LoadData();
            }

            await LibrarySource.UpdateBooks();
        }
コード例 #2
0
 /// <summary>
 /// Loads the library if it isn't already.
 /// </summary>
 /// <returns></returns>
 private async System.Threading.Tasks.Task RetrieveLibrary()
 {
     if (LibrarySource == null)
     {
         LibrarySource = new BooksModel();
         if (!LibrarySource.IsDataLoaded)
         {
             await LibrarySource.LoadData();
         }
         DataContext = LibrarySource;
         LibraryListView.ItemsSource     = LibrarySource.SortedBooks;
         RecentReadsListView.ItemsSource = LibrarySource.RecentBooks;
     }
 }