Exemplo n.º 1
0
        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;
                    }
                    PocTableView.Source = new PocTableViewSource(Data);
                    PocTableView.ReloadData();
                    // 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)
            {
            }
        }
Exemplo n.º 2
0
        private async Task RefreshAsync()
        {
            if (useRefreshControl)
            {
                RefreshControl.BeginRefreshing();
            }

            if (useRefreshControl)
            {
                RefreshControl.EndRefreshing();
            }

            PocTableView.ReloadData();
        }