Exemple #1
0
 private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
 {
     if (EScienceNewsModel != null)
     {
         EScienceNewsModel.GetShareContent(args.Request);
     }
 }
 /// <summary>
 /// Refresh ViewModel items asynchronous
 /// </summary>
 public async Task RefreshData(bool isNetworkAvailable)
 {
     var refreshTasks = new Task[]
     {
         ScienceNewsModel.RefreshItems(isNetworkAvailable),
         EScienceNewsModel.RefreshItems(isNetworkAvailable),
         BbcScienceNewsModel.RefreshItems(isNetworkAvailable),
         SciencemagModel.RefreshItems(isNetworkAvailable),
         ScienceDailyModel.RefreshItems(isNetworkAvailable),
         TOIScienceModel.RefreshItems(isNetworkAvailable),
     };
     await Task.WhenAll(refreshTasks);
 }
 /// <summary>
 /// Load ViewModel items asynchronous
 /// </summary>
 public async Task LoadData(bool isNetworkAvailable)
 {
     var loadTasks = new Task[]
     {
         ScienceNewsModel.LoadItems(isNetworkAvailable),
         EScienceNewsModel.LoadItems(isNetworkAvailable),
         BbcScienceNewsModel.LoadItems(isNetworkAvailable),
         SciencemagModel.LoadItems(isNetworkAvailable),
         ScienceDailyModel.LoadItems(isNetworkAvailable),
         TOIScienceModel.LoadItems(isNetworkAvailable),
     };
     await Task.WhenAll(loadTasks);
 }