public async static Task DoWorkAsync(this UIViewController controller, string workTitle, Func <Task> work)
        {
            var hud = new Hud();

            hud.Show(workTitle);

            //Make sure the Toolbar is disabled too
            if (controller.ToolbarItems != null)
            {
                foreach (var t in controller.ToolbarItems)
                {
                    t.Enabled = false;
                }
            }

            try
            {
                NetworkActivity.PushNetworkActive();
                await work();
            }
            finally
            {
                NetworkActivity.PopNetworkActive();
                hud.Hide();

                //Enable all the toolbar items
                if (controller.ToolbarItems != null)
                {
                    foreach (var t in controller.ToolbarItems)
                    {
                        t.Enabled = true;
                    }
                }
            }
        }
예제 #2
0
 public void Down()
 {
     if (_value == 0)
     {
         return;
     }
     _value--;
     NetworkActivity.PopNetworkActive();
 }