TextTrimming
Overview
The TextTrimming property allows you to control how text is displayed when it exceeds the maximum available space in a control. This property is accessible by text-displaying controls, such as TextBlock, SelectableTextBlock or ContentPresenter.
Text trimming adds an ellipsis (…) to indicate truncated text, instead of abruptly cutting off the text.
note
Avalonia uses the Unicode ellipsis character U+2026 by default, not three periods.
Trimming modes
Avalonia provides six text trimming options:
- None
- CharacterEllipsis
- WordEllipsis
- PrefixCharacterEllipsis
- LeadingCharacterEllipsis
- PathSegmentEllipsis
None
No trimming is applied. Text is cut off when it reaches the boundary of the control.
<TextBlock Text="This is a very long line of text that will get cut off."
TextTrimming="None"
Width="200" />
