Table of Contents

Method GetSubViews

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

GetSubViews(bool, bool, bool)

Gets all SubViews of this View, optionally including SubViews of the View's Adornments (Margin, Border, and Padding).

public virtual IReadOnlyCollection<View> GetSubViews(bool includeMargin = false, bool includeBorder = false, bool includePadding = false)

Parameters

includeMargin bool

If true, includes SubViews from Margin. If false (default), returns only the direct SubViews of this View.

includeBorder bool

If true, includes SubViews from Border. If false (default), returns only the direct SubViews of this View.

includePadding bool

If true, includes SubViews from Padding. If false (default), returns only the direct SubViews of this View.

Returns

IReadOnlyCollection<View>

A read-only collection containing all SubViews. If includeMargin is true, the collection includes SubViews from this View's direct SubViews as well as SubViews from the Margin, Border, and Padding adornments.

Remarks

This method returns a snapshot of the SubViews at the time of the call. The collection is safe to iterate even if SubViews are added or removed during iteration.

The order of SubViews in the returned collection is:

  1. Direct SubViews of this View
  2. SubViews of Margin (if includeMargin is true)
  3. SubViews of Border (if includeBorder is true)
  4. SubViews of Padding (if includePadding is true)