Table of Contents

Method AddAt

Namespace
Terminal.Gui.ViewBase
Assembly
Terminal.Gui.dll

AddAt(int, View?)

Adds a SubView (child) to this view at the specified index in the SubViews list.

public View? AddAt(int index, View? view)

Parameters

index int

The index at which to insert the view.

view View

The view to add.

Returns

View

The view that was added.

Remarks

The Views that have been added to this view can be retrieved via the SubViews property.

To check if a View has been added to this View, compare it's SuperView property to this View.

SubViews will be disposed when this View is disposed. In other-words, calling this method causes the lifecycle of the subviews to be transferred to this View.

Calls/Raises the OnSubViewAdded(View)/SubViewAdded event.

The OnSuperViewChanged(ValueChangedEventArgs<View?>)/SuperViewChanged event will be raised on the added View.

See Also