Xamarin.Forms Guides | Samples

Xamarin.Forms.Layout<T>.Children Property

Gets an IList<View> of child element of the Layout.

Syntax

public IList<T> Children { get; }

Value

A IList<View>. The default is an empty list.

Remarks

The Children collection of a Layout contains all the children added throught the public add/remove interface. Internal children will not be exposed through this collection.

The following shows the creation of a layout, setting a property, and adding the children in the object initializer.

C# Example

  var stack = new StackLayout {
    Spacing = 20,
    Children = {
      new Label {Text = "Hello World!"},
      new Button {Text = "Click Me!"}
    }
  };

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0