0

I'm working on Xamarin Forms application in visual studio 2017 , I want to disable a button and change the button text ,I disabled the button as mention in the below code. it's working fine for Android not for IOS ,In IOS after button disabled user able to click the button again and again but appearance looks disabled ,but click event get fires

   public void btnAction_Click(object sender, System.EventArgs e)
        {
            PerformAction();
        }

        private void PerformAction()
        {
            btnAction.IsEnabled = false;
            string btnText = btnAction.Text;
            btnAction.Text = L10N.Localize("Sending") + "...";
        }

1 Answers1

2

maybe try to define the "IsEnabled" property after the Command property.

<Button Command="{Binding YourCommand}" IsEnabled="{Binding YourIsEnabledProperty}" /> 
Rom
  • 1,183
  • 1
  • 8
  • 18