コード例 #1
0
        private async void BuscarViaEndereco(object sender, EventArgs args)
        {
            try
            {
                aparece();
                await Task.Delay(1000);

                if (CrossConnectivity.Current.IsConnected)
                {
                    List <Endereco> end = ViaCepService.BuscarCEPViaEndereco(uf.Text, cidade.Text, logradouro.Text);
                    CepList.ItemsSource = end;
                }
                else
                {
                    await DisplayAlert("ERRO", "Sem internet, verifique sua conexão e tente novamente", "OK");
                }
                some();
            }
            catch (Exception)
            {
                some();
                await DisplayAlert("ERRO", "Algum campo está inválido, verifique se os campos estão escritos corretamente e tente novamente.", "Ok");
            }
        }