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

Decoration

public TextDecoration Decoration { get; set; }

Property Value

TextDecoration

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

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

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>