Exemplo n.º 1
0
        /// <summary>
        /// Called automatically in ViewDidLoad()
        /// </summary>
        protected void StartLoadingScreen(string message)
        {
            using (var pool = new NSAutoreleasePool()) {
                this.InvokeOnMainThread(delegate {
                    var bounds = new RectangleF(0, 0, 768, 1004);
                    if (InterfaceOrientation == UIInterfaceOrientation.LandscapeLeft ||
                        InterfaceOrientation == UIInterfaceOrientation.LandscapeRight)
                    {
                        bounds = new RectangleF(0, 0, 1024, 748);
                    }

                    if (AppDelegate.IsPhone)
                    {
                        bounds = new RectangleF(0, 0, 320, 460);
                    }

                    loadingView = new UILoadingView(message, bounds);
                    // because DialogViewController is a UITableViewController,
                    // we need to step OVER the UITableView, otherwise the loadingOverlay
                    // sits *in* the scrolling area of the table
                    View.Superview.Add(loadingView);
                    View.Superview.BringSubviewToFront(loadingView);
                    View.UserInteractionEnabled = false;
                });
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// If a loading screen exists, it will fade it out.
 /// Your subclass MUST call this method once data has loaded (or a loading error occurred)
 /// to make the loading screen disappear and return control to the user
 /// </summary>
 protected void StopLoadingScreen()
 {
     using (var pool = new NSAutoreleasePool()) {
         InvokeOnMainThread(delegate {
             if (loadingView != null)
             {
                 Debug.WriteLine("Fade out loading...");
                 loadingView.OnFinishedFadeOutAndRemove += delegate {
                     if (loadingView != null)
                     {
                         Debug.WriteLine("Disposing of loadingView object..");
                         loadingView.Dispose();
                         loadingView = null;
                     }
                 };
                 loadingView.FadeOutAndRemove();
                 View.UserInteractionEnabled = true;
             }
         });
     }
 }
        /// <summary>
        /// Called automatically in ViewDidLoad()
        /// </summary>
        protected void StartLoadingScreen(string message)
        {
            using (var pool = new NSAutoreleasePool ()) {
                this.InvokeOnMainThread(delegate {

                    var bounds = new RectangleF(0,0,768,1004);
                    if (InterfaceOrientation == UIInterfaceOrientation.LandscapeLeft
                    || InterfaceOrientation == UIInterfaceOrientation.LandscapeRight) {
                        bounds = new RectangleF(0,0,1024,748);
                    }

                    if (AppDelegate.IsPhone)
                        bounds = new RectangleF(0,0,320,460);

                    loadingView = new UILoadingView (message, bounds);
                    // because DialogViewController is a UITableViewController,
                    // we need to step OVER the UITableView, otherwise the loadingOverlay
                    // sits *in* the scrolling area of the table
                    View.Superview.Add (loadingView);
                    View.Superview.BringSubviewToFront (loadingView);
                    View.UserInteractionEnabled = false;
                });
            }
        }
 /// <summary>
 /// If a loading screen exists, it will fade it out.
 /// Your subclass MUST call this method once data has loaded (or a loading error occurred)
 /// to make the loading screen disappear and return control to the user
 /// </summary>
 protected void StopLoadingScreen()
 {
     using (var pool = new NSAutoreleasePool ()) {
         InvokeOnMainThread(delegate {
             if (loadingView != null) {
                 Debug.WriteLine ("Fade out loading...");
                 loadingView.OnFinishedFadeOutAndRemove += delegate {
                     if (loadingView != null) {
                         Debug.WriteLine ("Disposing of loadingView object..");
                         loadingView.Dispose();
                         loadingView = null;
                     }
                 };
                 loadingView.FadeOutAndRemove ();
                 View.UserInteractionEnabled = true;
             }
         });
     }
 }