Skip to main content

TextFlow Class

NuGet: GHIElectronics.TinyCLR.UI
Assembly: GHIElectronics.TinyCLR.UI
Namespace: GHIElectronics.TinyCLR.UI.Controls

An element that lays out and scrolls a collection of styled text runs across multiple wrapped lines.

public class TextFlow : UIElement

Constructors​

TextFlow()​

public TextFlow()

Initializes a new instance of the TextFlow class.

Properties​

ScrollingStyle​

public ScrollingStyle ScrollingStyle { get; set; }

Whether hardware-button scrolling advances by line or by page.

TextAlignment​

public TextAlignment TextAlignment { get; set; }

The horizontal alignment of each line of text.

TopLine​

public int TopLine { get; set; }

The index of the first line currently displayed at the top.

LineCount​

public int LineCount { get; }

The total number of wrapped lines after the last measure.

Methods​

MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)​

protected override void MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)

Wraps the text runs into lines and measures the total height required.

OnButtonDown(GHIElectronics.TinyCLR.UI.Input.ButtonEventArgs e)​

protected override void OnButtonDown(GHIElectronics.TinyCLR.UI.Input.ButtonEventArgs e)

Handles the Up/Down hardware buttons to scroll the text by line or page.

OnRender(Media.DrawingContext dc)​

public override void OnRender(Media.DrawingContext dc)

Draws the visible wrapped lines starting from the current top line.

Fields​

TextRuns​

public TextRunCollection TextRuns

The collection of text runs displayed by this element.