RedPlum.MBProgressHUD.Show C# (CSharp) Метод

Show() публичный Метод

public Show ( bool animated ) : void
animated bool
Результат void
		public void Show (bool animated)
		{
			UseAnimation = animated;
			
			// If the grace time is set postpone the HUD display
			if (this.GraceTime > 0.0) {
				this.GraceTimer = NSTimer.CreateScheduledTimer (this.GraceTime, HandleGraceTimer);
				// ... otherwise show the HUD imediately 
			} else {
				this.SetNeedsDisplay ();
				ShowUsingAnimation (UseAnimation);
			}
		}

Usage Example

Пример #1
0
        public static void DoWork(this UIViewController controller, Action work, Action<Exception> error = null, Action final = null)
        {
            MBProgressHUD hud = null;
            hud = new MBProgressHUD(controller.View.Superview) {Mode = MBProgressHUDMode.Indeterminate, TitleText = "Loading..."};
            controller.View.Superview.AddSubview(hud);
            hud.Show(true);

            ThreadPool.QueueUserWorkItem(delegate {
                try
                {
                    Utilities.PushNetworkActive();
                    work();
                }
                catch (Exception e)
                {
                    if (error != null)
                        error(e);
                    controller.InvokeOnMainThread(delegate {
                        Utilities.ShowAlert("Error", e.Message);
                    });
                }
                finally 
                {
                    Utilities.PopNetworkActive();
                    if (final != null)
                        controller.InvokeOnMainThread(() => final());
                }
                
                if (hud != null)
                {
                    controller.InvokeOnMainThread(delegate {
                        hud.Hide(true);
                        hud.RemoveFromSuperview();
                    });
                }
            });
        }
All Usage Examples Of RedPlum.MBProgressHUD::Show