Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddOn Button Formatting Trigger Update

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

    AddOn Button Formatting Trigger Update

    Hello,

    It seems like the buttons we add to windows are added upon compiling/importing the AddOn.

    Is there a way to have the button update color based on a trigger (like an order being placed). We would like this to work without having to click the button.

    Thanks

    #2
    Hello, thanks for your post.

    You should be able to change the color by changing the button object's Background brush e.g.

    button.Background = Brushes.Blue;

    button would be the button object set up through LogicalTreeHelper.FindLogicalNode(...)

    Please let me know if this does not resolve your inqury.

    Comment


      #3
      We are able to set the background color but is there a way to make it dynamic so it is referencing a trigger other than onclick or hover?

      For example our AddOn has an enabled and disabled state. We would like the color to be Green when enabled and Grey when disabled. (Even if the user didn't click that particular button we are placing on the SuperDOM)

      Comment


        #4
        Hello, thanks for your reply.

        I'm not sure how exactly that would be done. It would depend on how your addon is going into this disabled state. If you have some function or event that puts it into a disabled state, that would be the place to change the colors.

        Best regards.

        Comment


          #5
          Can the color for a button be set from a function?

          We have tried this but it seemed like it can only be set when the AddOn is imported.

          Do you have any examples of a function setting the button color?

          Comment


            #6
            Hello, thanks for your reply.

            I do not have an example of this, unfortunately. This is more in the realm of general WPF/C# development so it does go out of the scope of support I can provide. If you attempted to change the color already and it did not work, the entire XAML document would need to be reloaded for the change to take effect.

            Please let me know if I can assist any further.

            Comment


              #7
              Chris,

              We were able to change the color however if multiple SuperDOMs are open it will only work for the most recent SuperDOM. Is there a way to loop through all open SuperDOM windows? Is there a different ID per window or windows elements that identifies the button we are adding differently?

              Comment


                #8
                Hi outcodenick, thanks for your reply.

                Our colleague made this script that adds buttons to all SuperDOM windows:
                https://ninjatraderecosystem.com/use...s-to-superdom/

                The addition happens on the OnWindowCreate method, so you can affect all windows that are loaded in the workspace.

                Best regards.

                Disclaimer
                The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                602 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                347 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                103 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                559 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                558 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X