Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wpf usercontrolcollection z index

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

    Wpf usercontrolcollection z index

    My indicator creates a stackpanel in the usercollection, which is in the topleft corner (I've occupied the other corners).
    The standard draingtools tile indicator also is in the topleft corner, and is below my indicators stackpanel (it's also in the usercollection).
    I've set the drawingtools to only visible when chart is active, and I want it to be in front then.
    Is there a way to set my panel to a lower z index so it's behind the drawingtools tile?

    #2
    Hello wjadevries,

    Objects added to the UserControlCollection are layered in the order the objects are added.

    Change the order the objects are added to change how these are layered.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I know.
      the problem is that another indicator (DrawingToolsTile) is adding objects to the usercollection, and my indicator also.
      I want my indicators objects below the Drawingtools.
      Can I do that?

      PS: already tried changing the order of the indicators by moving up/down in the charts indicator window, butthat also didn't help.

      Comment


        #4
        Hello wjadevries,

        So one indicator is adding WPF objects to the UserControlCollection and another indicator is drawing objects (which would be in the DrawObjects collection). You want drawing objects drawn by the second indicator on top of the UserControlCollection, is this correct?

        Unfortunately, the UserControlCollection is a single object controlled by the NinjaTrader core that lays over the chart and allows for WPF rendered objects to be added. Drawing objects, indicator plots, chart bars, lines, and anything rendered in OnRender is rendered in the chart RenderTarget as SharpDX below the UserControlCollection layer.

        There isn't a way to change this as these are two different rendering engines.

        You could choose to add all the rendering to OnRender and then check IsInHitTest to see if your object was clicked on.


        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          No, BOTH indicators are adding WPF objects to the usercontrolcollection.
          I just want to make sure that the objects from my indicator are below the objects from the other.

          Comment


            #6
            Hello wjadevries,

            Thank you for clarifying.

            These objects that are within the UserControlCollection are wpf objects.

            You could have one script use UserControlCollection.Insert(0, myObject) to add things to the bottom of the stack) and another script use UserControlCollection.Add(myObject) to add things to the top of the stack.

            You can loop through the UserControlCollection and .Add() or Remove() items. If you remove something and re-add it, it will be at the top of the stack as it was last added.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I even tried that already, so insert at 0 if somethings already there and otherwise add.
              but that also didn't help, so i thought you might maintain a separate usercontrolcollection per indicator.
              if that's not the case I'll try some more, like removing and re adding existing objects.

              Comment


                #8
                Hello wjadevries,

                There is only one UserControlCollection layer on a chart.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                599 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                345 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
                558 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