예제 #1
0
 public Task <bool> ActualizeAsync()
 {
     return(ExecuteSafe(async() =>
     {
         await Initialize();
         if (await _permissionsService.CanDownload())
         {
             foreach (var forecast in ForecastManager.GetForecasts())
             {
                 Uri url = GetApiUrl(forecast);
                 var service = new HttpService();
                 var feedresult = await service.DownloadAsync(url);
                 if (feedresult.IsRequestSuccessfull)
                 {
                     OpenWeatherMapHelper.EvaluateFeed(await feedresult.GetResponseAsStringAsync(),
                                                       _weatherFontMapping, forecast);
                 }
             }
             await SaveForecastsAsync();
         }
         return true;
     }));
 }
예제 #2
0
        private async void PermissionsServiceOnPermissionsChanged(object sender, EventArgs eventArgs)
        {
            _canRefresh = await _permissionsService.CanDownload();

            _refreshCommand.RaiseCanExecuteChanged();
        }