• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding menu item to ControlCenter

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Adding menu item to ControlCenter

    Hi, Is there any sample code for adding a separator and menu item to the Help menu in the ControlCenter? The image shows the menu that I'd like to add to:


    #2
    Hello,

    Thank you for the post.

    I didn't see a specific sample for this so I have created one that includes a Separator. I have included an Addon and an Indicator sample as there are some differences in getting the Control center window.

    To add items into the Help menu, you would need to change the Automation ID used in the samples. Currently the samples utilize the New menu which is named "ControlCenterMenuItemNew" this can be replaced with "ControlCenterMenuItemHelp" to instead use the Help menu.

    Also I will include below the code used to Print the resource keys, this is helpful when you do not know what resource may have been used for an item. In this case I needed to locate what resource is used to Style the Separator control for the default items which is "MainMenuSeparator".

    Code:
    foreach (ResourceDictionary resourceDictionary in Application.Current.Resources.MergedDictionaries)
    {
    	foreach (object key in resourceDictionary.Keys)
    	{
    		Print(  key   );
    	}
    }
    I look forward to being of further assistance.
    Attached Files
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks Jesse, I'm VERY grateful to you for your very diligent and helpful reply.
      Your effort has allowed me to get on with my real work instead of spending days figuring that out. I appreciate it so much.

      I modified your example code for finding resources to include the resource type name. The catch block was necessary because the resource dictionary will throw an exception for certain keys.

      Code:
      foreach (ResourceDictionary resourceDictionary in Application.Current.Resources.MergedDictionaries) {
          foreach (object key in resourceDictionary.Keys) {
              try { Print(key + ": " + resourceDictionary[key].GetType().ToString()); } catch { }
          }
      }

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Dan_D_Trader, Today, 03:49 PM
      0 responses
      4 views
      0 likes
      Last Post Dan_D_Trader  
      Started by JohnAymin, Today, 02:38 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Tyler  
      Started by Rmos22, Today, 02:20 PM
      2 responses
      22 views
      0 likes
      Last Post Rmos22
      by Rmos22
       
      Started by sawtooth500, Today, 12:59 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Spencer  
      Started by Steve L, Yesterday, 09:36 PM
      1 response
      22 views
      0 likes
      Last Post NinjaTrader_Kate  
      Working...
      X