Example #1
0
        private async void AdicionarButton_TouchUpInside(object sender, EventArgs e)
        {
            AdicionarButton.Enabled = false;

            using (var client = new TarefaService())
            {
                try
                {
                    await client.GravarAsync(new Tarefa { Descricao = TarefaTextField.Text });
                }
                catch (Exception)
                {
                    const string retorno =
                        "Ocorreu um erro ao realizar operação! Por favor, tente novamente mais tarde!";
                    new UIAlertView("Adicionar Tarefa", retorno, null, "OK", null).Show();
                    AdicionarButton.Enabled = true;
                    return;
                }
            }

            NSUserDefaults.StandardUserDefaults.SetBool(true, "UpdatedApi");
            NavigationController.PopToRootViewController(true);
            //
        }