Skip to main content

TextPathSegmentTrimming Class

Definition​

Namespace:Avalonia.Media
Assembly:Avalonia.Base
Package:Avalonia

Provides a text trimming strategy that collapses overflowing text by replacing path segments with an ellipsis string.

public class TextPathSegmentTrimming

Inheritance: object -> TextTrimming -> TextPathSegmentTrimming

Remarks​

Use this class to trim text representing file or URI paths, replacing intermediate segments with a specified ellipsis when the text exceeds the available width. This approach helps preserve the most relevant parts of the path, such as the filename or endpoint, while indicating omitted segments. The ellipsis string can be customized to match application requirements.

Constructors​

NameDescription
TextPathSegmentTrimmingInitializes a new instance of the TextPathSegmentTrimming class with the specified ellipsis string to indicate trimmed text.

TextPathSegmentTrimming Constructor​

Initializes a new instance of the TextPathSegmentTrimming class with the specified ellipsis string to indicate trimmed text.

public TextPathSegmentTrimming(string ellipsis)

Parameters​

ellipsis string

The string to use as an ellipsis when text is trimmed. This value is displayed at the end of truncated segments.

Methods​

NameDescription
CreateCollapsingPropertiesNo summary available.
ParseParses a text trimming string. Names must match static properties defined in this class. Inherited from TextTrimming.
ToStringNo summary available.

CreateCollapsingProperties Method​

public Avalonia.Media.TextFormatting.TextCollapsingProperties CreateCollapsingProperties(Avalonia.Media.TextCollapsingCreateInfo createInfo)

Parameters​

createInfo Avalonia.Media.TextCollapsingCreateInfo

Returns​

Avalonia.Media.TextFormatting.TextCollapsingProperties

ToString Method​

public string ToString()

Returns​

string

Properties​

NameDescription
CharacterEllipsisText is trimmed at a character boundary. An ellipsis (...) is drawn in place of remaining text. Inherited from TextTrimming.
LeadingCharacterEllipsisText is trimmed at a character boundary starting from the beginning. An ellipsis (...) is drawn in place of remaining text. Inherited from TextTrimming.
NoneText is not trimmed. Inherited from TextTrimming.
PathSegmentEllipsisGets a text trimming strategy that inserts an ellipsis to indicate omitted segments in a path string. Inherited from TextTrimming.
PrefixCharacterEllipsisText is trimmed after a given prefix length. An ellipsis (...) is drawn in between prefix and suffix and represents remaining text. Inherited from TextTrimming.
WordEllipsisText is trimmed at a word boundary. An ellipsis (...) is drawn in place of remaining text. Inherited from TextTrimming.