Skip to main content

TextBlock

Description​

Fluence TextBlock presents text using the Fluent typography ramp.

Use it for read-only text that should follow the Fluent typography ramp.

TextBlock in light mode TextBlock in dark mode

Example usage​

<fluence:TextBlock Text="Section heading" Typography="Subtitle" />

Key properties​

PropertyDefaultPurpose
TextEmpty stringText to display.
TypographyBodySelects a Fluent typography role.
TextWrappingNoWrapControls line wrapping.
TextTrimmingNoneControls trimming when text overflows.

State and behavior​

Typography selects the named font-size role. An explicit FontSize set locally, through a binding, or by an application style takes precedence; removing that override restores the named size. Theme changes update the foreground and continue to supply the font family.

Parts​

TextBlockExtensions​

Description​

TextBlockExtensions adds Fluent typography and related attached properties to native text. The screenshots show TextBlockExtensions inside TextBlock.

The gallery image shows the typography ramp on a native TextBlock. It does not isolate an attached TextBlockExtensions property.

See the parent control captures above for this part in context.

Example usage​

<TextBlock Text="Section heading"
fluence:TextBlockExtensions.Typography="Subtitle" />

State and behavior​

Attached typography and selection properties change native text presentation.

Reference​

Additional behavior​

Typography styles such as BodyTextBlockStyle and TitleLargeTextBlockStyle are application resources. See theming.

Reference​