Skip to content

TextBlock

Summary

Represents the Text Block - the control to display a non-interactive text.

Signature

1
public class TextBlock : Control

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 add a text block control on your chart
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class TextBlockSample : Indicator
     {
         [Parameter("Text", DefaultValue = "Sample text")]
         public string Text { 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 = Text, FontWeight = FontWeight.ExtraBold, ForegroundColor = Color.Blue });
             Chart.AddControl(stackPanel);
         }
         public override void Calculate(int index)
         {
         }
     }
 }

See Also

Properties

Text

Summary

Gets or sets the text.

Signature

1
public string Text {get; set;}

Return Value

string

TextAlignment

Summary

Gets or sets the text alignment.

Signature

1
public TextAlignment TextAlignment {get; set;}

Return Value

TextAlignment

Related Tutorials

LineHeight

Summary

Gets or sets the height of the line.

Signature

1
public double LineHeight {get; set;}

Return Value

double

LineStackingStrategy

Summary

Gets or sets the mechanism by which a line box is determined for each line of text within the TextBlock.

Signature

1
public LineStackingStrategy LineStackingStrategy {get; set;}

Return Value

LineStackingStrategy

Related Tutorials

TextWrapping

Summary

Gets or sets the way how the TextBlock should wrap the text.

Signature

1
public TextWrapping TextWrapping {get; set;}

Return Value

TextWrapping

Related Tutorials

TextTrimming

Summary

Gets or sets the text trimming behavior when the content overflows the content area.

Signature

1
public TextTrimming TextTrimming {get; set;}

Return Value

TextTrimming

Related Tutorials