Xamarin Forms Update Button Text Code

89

Xamarin Forms Update Button Text Code -

private async void Btn1_Clicked(object sender, EventArgs e)
{
   var btn = (Button)sender;
   btn.Text = "Wait";

   ...some code...maybe async or not (take out async above if not)

   Device.BeginInvokeOnMainThread(() =>
   {
        btn.Text = "Do Something";
   });
}

Comments

Submit
0 Comments