Xamarin.Forms Guides | Samples

Xamarin.Forms.VisualElement.IsVisible Property

Gets or sets a value that determines whether this elements should be part of the visual tree or not. This is a bindable property.


public Boolean IsVisible { get; set; }


true if the element should be rendered; otherwise, false. Default value is true.


Setting IsVisible to false will remove the element from the visual tree. The element will no longer take up space in layouts or be eligle to receive any kind of input event.

The following example shows a stack where the middle element is toggled when a button is activated.

C# Example

  partial class LabelToggle {
    Label label;

    void Build ()
      var firstView = new Button {Text = "Tap Me"};
      label = new Label {Text = "I can be toggled"};
      var thirdView = new Image {Source = "image.png"};

      firstView.Activated += OnButtonActivated;

      Content = new StackLayout {
        Children {

    void OnButtonActivated (object sender, EventArgs args)
      label.IsVisible = !label.IsVisible;


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