How do I draw the same buttons on the Chart Trader panel?
I assume/hope there is a simple addition that moves it from the chart to the chart trader, but I haven't been able to find it
thanks
private System.Windows.Controls.Grid myGrid;
​
Dispatcher.InvokeAsync((() =>
{
myGrid = new System.Windows.Controls.Grid
{
Name = "MyCustomGrid", HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Top
};
System.Windows.Controls.ColumnDefinition column1 = new System.Windows.Controls.ColumnDefinition();
System.Windows.Controls.ColumnDefinition column2 = new System.Windows.Controls.ColumnDefinition();
myGrid.ColumnDefinitions.Add(column1);
myGrid.ColumnDefinitions.Add(column2);
longButton = new System.Windows.Controls.Button
{
Name = "LongButton", Content = "LONG", Foreground = Brushes.White, Background = Brushes.Green
};
shortButton = new System.Windows.Controls.Button
{
Name = "ShortButton", Content = "SHORT", Foreground = Brushes.Black, Background = Brushes.Red
};
longButton.Click += OnButtonClick;
shortButton.Click += OnButtonClick;
System.Windows.Controls.Grid.SetColumn(longButton, 0);
System.Windows.Controls.Grid.SetColumn(shortButton, 1);
myGrid.Children.Add(longButton);
myGrid.Children.Add(shortButton);
UserControlCollection.Add(myGrid);
}));​

Comment