Xamarin.Forms Guides | Samples

Xamarin.Forms.VisualElement.IsEnabled Property

Gets or sets a value indicating whether this element is enabled in the user interface. This is a bindable property.


public Boolean IsEnabled { get; set; }


true if the element is enabled; otherwise, false. The default value is true


Elements that are not enabled do not participate in hit detection, and therefore will not receive focus or emit input events.

The following example shows a handler on a button which will then set IsEnabled to false on another button.

C# Example

  public partial class ButtonDisableExample {
    void BuildButtons ()
      Button button1 = new Button {Text = "New button"};
      Button button2 = new Button {Text = "Disabled on click"};
      button1.Activated += (o, e) => button2.IsEnabled = false;


Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions:,,,,,,