Border


Summary

Represents the border.

Syntax

public class Border : ControlBase

Members

NameTypeSummary
BackgroundColor PropertyGets or sets the color of the border background. Check the Color class for the ARGB (alpha, red, green, blue) color values, or use the strings Color.Red, Color.FromName("Red"), Color.FromArgb(255, 0, 0), Color.FromHex("#ff0000"), "Red", "#ff0000".
Border MethodInitializes a new instance of the Border class.
BorderColor PropertyGets or sets the border line color. Check the Color class for the ARGB (alpha, red, green, blue) color values, or use the strings Color.Red, Color.FromName("Red"), Color.FromArgb(255, 0, 0), Color.FromHex("#ff0000"), "Red", "#ff0000".
BorderThickness PropertyGets or sets the border thickness. Property value can be set using Thickness, number, or a string new Thickness(5), new Thickness(1, 2, 3, 4), 5, "5", "1 2 3 4".
Child PropertyGets or sets the border child object.
CornerRadius PropertyGets or sets the border corner radius. Property value can be set using CornerRadius, number, or a string: new CornerRadius(5), new CornerRadius(1, 2, 3, 4).
Padding PropertyGets or sets the border padding thickness. Property value can be set using Thickness, number, or a string new Thickness(5), new Thickness(1, 2, 3, 4), 5, "5", "1 2 3 4".

Example 1

using cAlgo.API;
namespace cAlgo
{
    // A sample indicator that shows how to use Border chart control
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class BorderSample : Indicator
    {
        protected override void Initialize()
        {
            var border = new Border
            {
                BorderColor = Color.Yellow,
                BorderThickness = 2,
                Opacity = 0.5,
                BackgroundColor = Color.Violet,
                HorizontalAlignment = HorizontalAlignment.Right,
                VerticalAlignment = VerticalAlignment.Bottom,
                Width = 200,
                Height = 100,
                Margin = 10
            };
            var stackPanel = new StackPanel
            {
                Orientation = Orientation.Vertical
            };
            stackPanel.AddChild(new TextBlock
            {
                Text = "Text",
                Margin = 5,
                HorizontalAlignment = HorizontalAlignment.Center,
                FontWeight = FontWeight.ExtraBold
            });
            stackPanel.AddChild(new Button
            {
                Text = "Button",
                Margin = 5,
                HorizontalAlignment = HorizontalAlignment.Center,
                FontWeight = FontWeight.ExtraBold
            });
            stackPanel.AddChild(new TextBox
            {
                Text = "Type text...",
                Margin = 5,
                HorizontalAlignment = HorizontalAlignment.Center,
                FontWeight = FontWeight.ExtraBold,
                Width = 100
            });
            border.Child = stackPanel;
            Chart.AddControl(border);
        }
        public override void Calculate(int index)
        {
        }
    }
}
Reference