async void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) { if (!LibrarySource.IsDataLoaded) { await LibrarySource.LoadData(); } await LibrarySource.UpdateBooks(); }
/// <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; } }