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;
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public void Down()
 {
     if (_value == 0)
     {
         return;
     }
     _value--;
     NetworkActivity.PopNetworkActive();
 }
Ejemplo n.º 3
0
 public void Up()
 {
     _value++;
     NetworkActivity.PushNetworkActive();
 }