Skip to content

ChartDraggable.Child

property · ChartDraggable · cAlgo.API Since 5.2

DesktopCLICloud

Get / set the content control inside the draggable.

Environment behaviour

CLI — not supported. Never displayed: starts at X=0, Y=0; property changes are kept locally only and LocationChanged never fires.

Cloud — not supported. Never displayed: starts at X=0, Y=0; property changes are kept locally only and LocationChanged never fires.

Definition

ControlBase Child {get; set;}
chartDraggable.Child: ControlBase

Returns ControlBase

Examples

var button = new Button { Text = "Buy", BackgroundColor = Color.Green };
button.Click += _ => ExecuteMarketOrder(TradeType.Buy, SymbolName, Symbol.VolumeInUnitsMin);
var draggable = Chart.Draggables.Add();
draggable.Child = button;
Print("Draggable child: {0}", draggable.Child);
button = Button()
button.Text = "Buy"
button.BackgroundColor = Color.Green
button.Click += lambda _: api.ExecuteMarketOrder(TradeType.Buy, api.SymbolName, api.Symbol.VolumeInUnitsMin)
draggable = api.Chart.Draggables.Add()
draggable.Child = button
api.Print(f"Draggable child: {draggable.Child}")