using Avalonia.Utilities; namespace Avalonia.Media.TextFormatting { /// /// a collapsing properties to collapse whole line toward the end /// at word granularity and with ellipsis being the collapsing symbol /// public class TextTrailingWordEllipsis : TextCollapsingProperties { private static readonly ReadOnlySlice s_ellipsis = new ReadOnlySlice(new[] { '\u2026' }); /// /// Construct a text trailing word ellipsis collapsing properties /// /// width in which collapsing is constrained to /// text run properties of ellispis symbol public TextTrailingWordEllipsis( double width, TextRunProperties textRunProperties ) { Width = width; Symbol = new TextCharacters(s_ellipsis, textRunProperties); } /// public sealed override double Width { get; } /// public sealed override TextRun Symbol { get; } /// public sealed override TextCollapsingStyle Style { get; } = TextCollapsingStyle.TrailingWord; } }