The original code is located here:
https://ninjatraderecosystem.com/user-app-share-download/shortcut-toolbar-by-ninjaaddons-com/
The Addon uses the NTMenuItem.Command property for each tool to invoke the drawing tool from the new sidebar menu. My problem is the NTMenuItem.Command property is null for any custom tool, so I am not able to use this to invoke the tool from the Addon sidebar menu.
The custom tools are invoked just fine from the Drawing Tool menu. So I have a couple of questions:
1) How does the Drawing Tool menu invoke Custom Drawing Tools?
2) How can I invoke a Custom Drawing Tool with code?
The code I added for the custom tools, mirrors the code for the standard tools.
public class NinjaAddonsToolBar : AddOnBase {[INDENT]private string[] CUSTOMTOOL_HEADERS = new string[3] { "Risk Reward 3", "Measured Move", "Horizontal Line Segment" }; [/INDENT][INDENT]// existing code [/INDENT][INDENT]protected override void OnWindowCreated(Window window) {[/INDENT][INDENT=2]// existing code #region -- Add Custom Tools -- else if (CUSTOMTOOL_HEADERS.Contains(mnItem.Header.ToString())) {[/INDENT][INDENT=3]verticalStackPanel.Children.Add(new NTMenuItem()[/INDENT][INDENT=4]{ ToolTip = mnItem.Header, Style = mnItem.Style, Icon = mnItem.Icon, [COLOR=#c0392b][B]Command = mnItem.Command,[/B][/COLOR] Margin = new Thickness(1), Width = ITEM_WIDTH, HorizontalAlignment = HorizontalAlignment.Left });[/INDENT][INDENT=3]}[/INDENT]
Thanks, Greg
Comment