TextTrimming
Summary
Describes how text is trimmed when it overflows the edge of its containing box.
Signature
Namespace
cAlgo.API
Examples
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 | using cAlgo.API;
namespace cAlgo
{
// This sample indicator shows how to use TextTrimming property to manage the text trim
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class TextTrimmingSample : Indicator
{
[Parameter("Text", DefaultValue = "very long texttttttttttttttttttttt")]
public string Text { get; set; }
[Parameter("Trimming", DefaultValue = TextTrimming.CharacterEllipsis)]
public TextTrimming TextTrimming { get; set; }
protected override void Initialize()
{
var stackPanel = new StackPanel
{
BackgroundColor = Color.Gold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Opacity = 0.6,
Width = 100
};
stackPanel.AddChild(new TextBlock
{
Text = Text,
FontWeight = FontWeight.ExtraBold,
ForegroundColor = Color.Blue,
TextTrimming = TextTrimming
});
Chart.AddControl(stackPanel);
}
public override void Calculate(int index)
{
}
}
}
|
Fields
None
Summary
Text is not trimmed.
Signature
| public static TextTrimming None;
|
Return Value
TextTrimming
CharacterEllipsis
Summary
Text is trimmed at a character boundary. An ellipsis (...) is drawn in place of remaining text.
Signature
| public static TextTrimming CharacterEllipsis;
|
Return Value
TextTrimming
WordEllipsis
Summary
Text is trimmed at a word boundary. An ellipsis (...) is drawn in place of remaining text.
Signature
| public static TextTrimming WordEllipsis;
|
Return Value
TextTrimming
Last update: November 30, 2023