Beispiel #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            setstyle();

            starthud();
            ThreadPool.QueueUserWorkItem(state =>
            {
                var lst = new iportogruaroLibraryShared.mainNews().getMainCategorys(true);

                InvokeOnMainThread(delegate {
                    TableView.Source = new sourceNews(this, lst);
                    TableView.ReloadData();
                    setLoadingViewStyle(this.TableView);
                    stophud();
                }
                                   );
            });
        }
Beispiel #2
0
        public void loadData()
        {
            if (!InternetConnection.IsNetworkAvaialable(true))
            {
                using (var alert = new UIAlertView("iPortogruaro", "Spiacente nessun collegamento internet al momento", null, "OK", null))//Viajes Telcel//Aceptar
                {
                    alert.Show();
                }

                return;
            }

            //if (!reloading) {
            if (reloading)
            {
                return;
            }

            reloading = true;

            UIView.BeginAnimations("slideAnimation");

            UIView.SetAnimationDuration(2);
            UIView.SetAnimationCurve(UIViewAnimationCurve.EaseInOut);
            UIView.SetAnimationRepeatCount(2);
            UIView.SetAnimationRepeatAutoreverses(true);
            this.TableView.ContentInset = UIEdgeInsets.Zero;
            UIView.CommitAnimations();

            /*
             *  [UIView beginAnimations:nil context:NULL];
             *  [UIView setAnimationDuration:.3];
             *  [tblMain setContentInset:UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)];
             *  [refreshHeaderView setStatus:kPullToReloadStatus];
             *  [refreshHeaderView toggleActivityView:NO];
             *  [UIView commitAnimations];
             */

            starthud();
            ThreadPool.QueueUserWorkItem(state =>
            {
                var lst = new iportogruaroLibraryShared.mainNews().getMainCategorys(false);

                InvokeOnMainThread(delegate {
                    TableView.Source = new sourceNews(this, lst);
                    TableView.ReloadData();
                    setLoadingViewStyle(this.TableView);
                    stophud();
                    reloading = false;
                }
                                   );
            });

            foreach (UIView vin in vLoading)
            {
                vin.RemoveFromSuperview();
                vin.Dispose();
            }
            vLoading.RemoveFromSuperview();
            vLoading.Dispose();
            vLoading = null;
            //startHud();
            //}
        }