Share via

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 bool IsVisible { get; set; }
member this.IsVisible : bool with get, set

Property Value


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.

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;

Applies to