This seems like a bug to me but I thought I would see if there is a reason. I noticed that when I assign a shortcut to a tool like Ctrl+R, that the ToolClick event fires even when the tool is hidden (shared props - hidden everywhere). To me it seems this should not happen. In my case I store a command object in each tool for execution and those commands are not set when the tool is torn down and hidden.
See the attached png file.
Hello Geoff,
I believe that this behavior is expected. A possible approach to avoid executing your code when the user presses the key combination for a not visible tool would be to check the state of the tool, like this:
private void ultraToolbarsManager1_ToolClick(object sender, ToolClickEventArgs e) { if(e.Tool.VisibleResolved) { //...your code goes here... } }
private void ultraToolbarsManager1_ToolClick(object sender, ToolClickEventArgs e)
{
if(e.Tool.VisibleResolved)
//...your code goes here...
}
Please do not hesitate to ask if something comes up.