Summary
Represents the Text Block - the control to display a non-interactive text.
Syntax
public class TextBlock : Control
Members
Name | Type | Summary |
---|---|---|
LineHeight | Property | Gets or sets the height of the line. |
LineStackingStrategy | Property | Gets or sets the mechanism by which a line box is determined for each line of text within the TextBlock. |
Text | Property | Gets or sets the text. |
TextAlignment | Property | Gets or sets the text alignment. |
TextBlock | Method | Initializes a new instance of the Text Block class. |
TextTrimming | Property | Gets or sets the text trimming behavior when the content overflows the content area. |
TextWrapping | Property | Gets or sets the way how the TextBlock should wrap the text. |
Example 1
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) { } } }