Class TextBlock

Namespace
Forma
Assembly
Forma.dll

Template-free read-only text foundation backed by the retained text layout path.

public class TextBlock : Label, IAddChild<Control>, IAddChild, INotifyPropertyChanged
Inheritance
TextBlock
Implements
Inherited Members

Constructors

TextBlock()

public TextBlock()

Properties

AlignInlineBaselines

When true, inline children of different sizes share one baseline per line.

public bool AlignInlineBaselines { get; set; }

Property Value

bool

Decoration

public TextDecoration Decoration { get; set; }

Property Value

TextDecoration

FocusedMeta

The meta of the focused stop, or null when this block is not focused.

public object FocusedMeta { get; }

Property Value

object

Inlines

public IList<Inline> Inlines { get; }

Property Value

IList<Inline>

LetterSpacing

public float LetterSpacing { get; set; }

Property Value

float

LineHeight

public float LineHeight { get; set; }

Property Value

float

MetaFocusable

Makes each revealed meta range a Tab stop that Enter or Space activates through MetaClicked.

public bool MetaFocusable { get; set; }

Property Value

bool

Text

public string Text { get; set; }

Property Value

string

UsesInlineContent

public bool UsesInlineContent { get; }

Property Value

bool

Methods

AdjustTextLayout(TextLayout)

protected override TextLayout AdjustTextLayout(TextLayout layout)

Parameters

layout TextLayout

Returns

TextLayout

DrawLabelText(UIRenderContext)

Draws this label's text. Rich-text derived controls can replace this while retaining child rendering.

protected override void DrawLabelText(UIRenderContext context)

Parameters

context UIRenderContext

GetCharacterBounds(int)

public override Rectangle GetCharacterBounds(int position)

Parameters

position int

Returns

Rectangle

GetMetaStops()

Local bounds of every revealed meta range in reading order; one entry per contiguous range.

public IReadOnlyList<(object Meta, IReadOnlyList<Rectangle> Bounds)> GetMetaStops()

Returns

IReadOnlyList<(object Meta, IReadOnlyList<Rectangle> Bounds)>

GetMetaUnderPosition(Point)

public object GetMetaUnderPosition(Point position)

Parameters

position Point

Returns

object

GetMinimumSize()

public override Vector2 GetMinimumSize()

Returns

Vector2

GetTextLineSpacing(UIFont)

protected override float GetTextLineSpacing(UIFont font)

Parameters

font UIFont

Returns

float

PointerPressed(Point)

A pointer press landed on this control, in global coordinates.

Protected as well as internal so a control defined outside this assembly can take part in pointer input. Without that, an app hosting its own drawing surface has to read raw mouse state instead, which bypasses hit-testing, modal gating and the injection side-channel — so such a surface cannot be driven by a test at all.

protected override void PointerPressed(Point position)

Parameters

position Point

Events

MetaClicked

public event Action<TextBlock, object> MetaClicked

Event Type

Action<TextBlock, object>