Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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";
   });
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Xamarin #Forms #Update #Button #Text #Code
ADD COMMENT
Topic
Name
3+9 =