title: How to associate a progress bar with a button in Xamarin with Visual studio?
body: <p>I'm new to the Xamarin world, so I'm in a real need of your help. In my very first application I want to associate a progress bar with a button. So that when I click the button the progress bar starts and when the progress ends the progress bar disappears. </p>
  
  <p>Here is my C# code:</p>
  
  <pre><code>translateButton.Click += (object sender, EventArgs e) =&gt;
  {
      ProgressBar pb = FindViewById&lt;ProgressBar&gt;(Resource.Id.progressBar1);
      Thread.Sleep(1000);
      pb.Enabled = true;
  
      translateNumber = Core.PhonewordTranslator.ToNumber(phoneNumberText.Text);
      if (string.IsNullOrWhiteSpace(translateNumber))
      {
           callButton.Text = "Call";
           callButton.Enabled = false;
           pb.Enabled = true;
      }
  
      else
      {
          callButton.Text = "Call" + translateNumber;
          callButton.Enabled = true;
          pb.Enabled = true;
      }
  };
  </code></pre>
  
  <p>this code from this <a href="https://developer.xamarin.com/guides/android/getting_started/hello,android/hello,android_quickstart/" rel="nofollow">tutorial</a> on Xamarin website.</p>