Class ViewCollection
A base class for container views that hold and manage a list of child views. Provides methods for adding, removing, rendering, and hit testing children.
public class ViewCollection : View, ILayerHost, IServiceProvider
- Inheritance
-
ViewCollection
- Implements
- Derived
- Inherited Members
- Extension Methods
Fields
children
The internal list of child views contained within this view.
protected readonly List<View> children
Field Value
Properties
Content
Adds the provided views to this container during object initialization. This property is intended for use with C# object initializers and will not clear existing children.
public ReadOnlySpan<View> Content { init; }
Property Value
Count
Gets the number of child views in this collection.
public override int Count { get; }
Property Value
this[int]
Gets the child view at the specified index.
public override View this[int index] { get; }
Parameters
indexint
Property Value
Methods
Add(View)
Adds a view to this container.
public virtual void Add(View child)
Parameters
childView
Exceptions
- InvalidOperationException
Thrown if the view already has a parent.
Clear()
Removes all child views from this container.
public virtual void Clear()
Remove(View)
Removes a view from this container.
public virtual void Remove(View child)
Parameters
childView