Skip to content

DockPanel

Summary

Defines the area where you can arrange child elemens either horizontally or vertically, relative to each other.

Signature

1
public class DockPanel : Panel

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
36
37
38
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample indicator shows how to use DockPanel
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class DockPanelSample : Indicator
     {
         protected override void Initialize()
         {
             var dockPanel = new DockPanel
             {
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
                 BackgroundColor = Color.Gold,
                 Opacity = 0.8
             };
             dockPanel.AddChild(new TextBlock
             {
                 Text = "Enter Your Name",
                 Margin = 5,
                 Dock = Dock.Top,
                 HorizontalAlignment = HorizontalAlignment.Center,
                 ForegroundColor = Color.Black,
                 FontWeight = FontWeight.ExtraBold
             });
             dockPanel.AddChild(new TextBox
             {
                 Dock = Dock.Bottom,
                 Margin = 5,
                 Width = 100
             });
             Chart.AddControl(dockPanel);
         }
         public override void Calculate(int index)
         {
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 import clr
 clr.AddReference("cAlgo.API")
 from cAlgo.API import *
 class Test():    
     def initialize(self):
         dockPanel = DockPanel()
         dockPanel.HorizontalAlignment = HorizontalAlignment.Center
         dockPanel.VerticalAlignment = VerticalAlignment.Center
         dockPanel.BackgroundColor = Color.Gold
         dockPanel.Opacity = 0.8
         textBlock = TextBlock()
         textBlock.Text = "Enter Your Name"
         textBlock.Margin = Thickness(5)
         textBlock.Dock = Dock.Top
         textBlock.HorizontalAlignment = HorizontalAlignment.Center
         textBlock.ForegroundColor = Color.Black
         textBlock.FontWeight = FontWeight.ExtraBold
         dockPanel.AddChild(textBlock)
         textBox = TextBox()
         textBox.Dock = Dock.Bottom
         textBox.Margin = Thickness(5)
         textBox.Width = 100
         dockPanel.AddChild(textBox)
         api.Chart.AddControl(dockPanel)

Properties

LastChildFill

Summary

Indicates whether the last child element within a DockPanel stretches to fill the remaining available space.

Signature

1
public bool LastChildFill {get; set;}

Return Value

bool