private async void LoadDropBoxContent() { try { if (CrossConnectivity.Current.IsConnected) { //loader.StartAnimating(); HttpClient httpClient = new HttpClient(); httpClient.BaseAddress = new Uri("https://dl.dropboxusercontent.com"); var dropBoxContentService = RestService.For <IDropBoxContent>(httpClient); var apiData = await dropBoxContentService.GetDropBoxContent(); Data = new List <DropBoxRow>(); Data = apiData.DropBoxRows; if (Data == null && Data.Count == 0) { return; } CView.Source = new DropBoxCVS(Data); CView.ReloadData(); //Collectionview //loader.StopAnimating(); // loader.Hidden = true; } else { var okAlertController = UIAlertController.Create("Alert Message", "Opps..Internet is Connected!!", UIAlertControllerStyle.Alert); okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); PresentViewController(okAlertController, true, null); } } catch (Exception ex) { } }
private async Task RefreshAsync() { if (useRefreshControl) { RefreshControl.BeginRefreshing(); } if (useRefreshControl) { RefreshControl.EndRefreshing(); } CView.ReloadData(); }