UI not updating through function

fmrock164fmrock164 Member ✭✭

I have a simple form that when you click the button, it will grab the data on in the form and send an email. I set a status label and color as it goes through the method, but yet, I only see the outcome. Never the "Sending" status.

Here is a simplified example. Do I need to use async calls?

        partial void BtnSendMessage_TouchUpInside(UIButton sender)
        {
            SetStatusLabel("Sending!", "Yellow");
            bool emailSent = Corefunctions.Send_Mail("My Subject", emailBody.ToString());
            if (emailSent)
                {
                    SetStatusLabel("Sent!", "Green");
                    return;
                }
                else
                {
                    SetStatusLabel("Error!", "Red");
                    return;
                }       
        }

Best Answers

  • fmrock164fmrock164 ✭✭
    Accepted Answer

    I made a version of the sendmail function that was async and got the labels to work correctly.
    Thanks for your help.

Answers

  • fmrock164fmrock164 Member ✭✭

    The send mail function is not async... Would making it asynchronous solve my UI issue?

  • fmrock164fmrock164 Member ✭✭
    Accepted Answer

    I made a version of the sendmail function that was async and got the labels to work correctly.
    Thanks for your help.

Sign In or Register to comment.