Forum Libraries, Components, and Plugins

Why Acr.UserDialogs doesn't show the loading?

I'm trying to show loading using Acr.UserDialogs on Xamarin. I want to show the loading while I will getting some informations from WebService but it does not works, the loading just not showing.

How could I fix this ?

Trying

 private async void OnBtnEnviarClick(object sender, EventArgs args){            

            try {
                if (checkFields()){

                    UserDialogs.Instance.ShowLoading("Wait...");

                    ContatoDTO dto = new ContatoDTO();
                    var nome = Nome.Text;
                    var email = Email.Text;
                    var assunto = Assunto.SelectedItem as String;
                    var mensagem = Mensagem.Text;

                    dto.nome = nome;
                    dto.email = email;
                    dto.assunto = assunto;
                    dto.mensagem = mensagem;

                    //from webservice
                    Dictionary<string, string> _resposta = UsuarioService.SendMailContatoApp(dto);

                    if (_resposta["status"].Equals("1"))
                    {
                        await DisplayAlert("Informação", _resposta["msg"], "Ok");
                        await Navigation.PopToRootAsync();
                    }
                    else
                    {
                        await DisplayAlert("Erro", _resposta["msg"], "Ok");
                    }

                }
            }
            catch (Exception e){
                await DisplayAlert("Erro", e.Message, "Ok");
            }finally{
                UserDialogs.Instance.HideLoading();
            }
        }
Tagged:

Best Answer

Answers

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    you should use

    using(UserDialogs.Instance.Loading("wait..."){
    
    // your async work
    
    }
    
Sign In or Register to comment.