Table of Contents

Method GetContentSize

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

GetContentSize()

Gets the size of the View's content.

public Size GetContentSize()

Returns

Size

If the content size was not explicitly set by SetContentSize(Size?), GetContentSize() will return the size of the Viewport and ContentSizeTracksViewport will be true.

Remarks

a>

See the View Layout Deep Dive for more information: https://gui-cs.github.io/Terminal.GuiV2Docs/docs/layout.html

If the content size was not explicitly set by SetContentSize(Size?), and the View has no visible subviews, GetContentSize() will return the size of Viewport.

If the content size was not explicitly set by SetContentSize(Size?), and the View has visible subviews, GetContentSize() will return the maximum position + dimension of the Subviews, supporting Auto(DimAutoStyle, Dim?, Dim?) with the Content flag set.

If set Viewport describes the portion of the content currently visible to the user. This enables virtual scrolling.

If set the behavior of Content will be to use the ContentSize to determine the size of the view.