TextAlignment
Summary
The text alignment regarding the anchor point.
Signature
| public enum TextAlignment
|
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 | using cAlgo.API;
namespace cAlgo
{
// This sample indicator shows how to use TextAlignment property to align the text
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class TextAlignmentSample : Indicator
{
[Parameter("Text Alignment", DefaultValue = TextAlignment.Center)]
public TextAlignment TextAlignment { get; set; }
protected override void Initialize()
{
var stackPanel = new StackPanel
{
BackgroundColor = Color.Gold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Opacity = 0.6,
Width = 200
};
stackPanel.AddChild(new TextBlock { Text = "Sample text", TextAlignment = TextAlignment });
Chart.AddControl(stackPanel);
}
public override void Calculate(int index)
{
}
}
}
|
Fields
Left
Summary
Align the text left.
Signature
| public static TextAlignment Left;
|
Return Value
TextAlignment
Right
Summary
Align the text right.
Signature
| public static TextAlignment Right;
|
Return Value
TextAlignment
Center
Summary
Center the text vertically.
Signature
| public static TextAlignment Center;
|
Return Value
TextAlignment
Justify
Summary
Justify the text.
Signature
| public static TextAlignment Justify;
|
Return Value
TextAlignment
Last update: November 30, 2023