Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

ExpandableObjectConverter not working with Stroke Property

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

    ExpandableObjectConverter not working with Stroke Property

    Because of the lack of a way to control a Properties Category expansion state in the property dialog(please please please address this), I gave the ExpandableObjectConverter a try....

    So, based on an example of ExpandableObjectConverter posted in this forum,

    I created:
    Code:
    [Display(Name = "My Colors", Description = "Expandable Brush Class", Order = 3, GroupName = "Parameters")]
    public MyColorCollection MyColors
    { get; set; }
    
    [TypeConverter(typeof(ExpandableObjectConverter))]
    public class MyColorCollection
    {
    public MyColorCollection()
    {
    
    }
    
    public override string ToString()
    {
    return string.Format("");
    }
    
    [Display(Name = "t1", Description = "Brush4", Order = 0)]
    public bool t1
    { get; set; }
    
    
    [Display(Name = "t2", Description = "Brush4", Order = 0)]
    public bool t2
    { get; set; }
    
    [Display(Order = 00, Name = "+3.00")]
    public Stroke IlUp300Stroke { get; set; }
    
    }
    When updating the strokes Color or Dash Style in the Property Editor, The apply button is NOT enabled.

    Editing the Stokes's Opacity% or Width DOES enable the apply button.

    I can't figure out a way to force the apply button to be enabled.

    #2
    Original example with stroke property that reproduces issue
    Attached Files

    Comment


      #3
      Hello michelm,

      Thanks for your post and also providing a test script.

      I have been able to reproduce the behavior and we are looking into this further.

      I will keep you posted as this develops.
      JimNinjaTrader Customer Service

      Comment


        #4
        Thanks. I tried to dig around in the NT API for some way to manually force the property state to dirty(in the stroke "set" method), but I really could not get too far without source code. I also tried setting one of the bool properties from within the strokes set method, but that did not trigger the apply button either.

        The ExpandableObjectConverter was an attempted workaround I saw in multiple forum posts.

        [CategoryDefaultExpanded(false)]
        public class Test : Indicator

        Was not working for me....every once in a while the first category is collapsed when first opening the property editor.

        I'd actually be pretty happy with ExpandableObjectConverter if I could figure it out for Strokes.

        Setting the Stroke color does seem to work if the "OK" button is pressed as an alternative to the disabled apply button.



        Comment


          #5
          Hello michelm,

          Thanks for your patience.

          After our review, we found this to be a known limitation with nested classes in the property grid. Strokes are built using an ExpandableObjectConverter and nesting the Stroke (or another ExpandableObjectConverter) within another ExpandableObjectConverter can lead to the symptoms you are describing. The suggestion would be to avoid nesting ExpandableObjectConverters, including Strokes. If these are separate properties that are not nested, you should not hit these symptoms.

          [CategoryDefaultExpanded(false)] is also not fully supported. GroupNames are handled internally and if a the group has already been added to the property grid, then [CategoryDefaultExpanded(false)] will not take affect. You can get this to collapse all groups when the attribute is added to a new script that has not been added to the property grid. If you have already added the script to the property grid, you can observe that if you change the GroupName of the property, the new group will be collapsed.

          We have been tracking interest for proper support for the ability to collapse property groups with the feature request ticket SFT-515. I have added a vote on your behalf.

          I have also opened another change request ticket to track interest behind supporting nested ExpandableObjectConverter properties. The ticket ID is SFT-5079.

          We cannot offer an ETA or promise of fulfillment, but your impact has been tracked.

          Please let us know if you have any additional questions.

          JimNinjaTrader Customer Service

          Comment


            #6
            Please add my votes for both features. Thanks!
            Multi-Dimensional Managed Trading
            jeronymite
            NinjaTrader Ecosystem Vendor - Mizpah Software

            Comment


              #7
              Thanks for your feedback jeronymite,

              Votes have been added.
              JimNinjaTrader Customer Service

              Comment


                #8
                Add my votes too. Thanks.

                Comment


                  #9
                  Hello Leeory_Jenkins,

                  Thanks for your feedback. Your votes have been added.
                  JimNinjaTrader Customer Service

                  Comment


                    #10
                    Was support for this added since 5-10-2021? If not, another +1 vote, please.

                    Comment


                      #11
                      Hello StevenL,

                      Support was not added for nested ExpandableObjectConverters.

                      I have added a vote on your behalf.
                      JimNinjaTrader Customer Service

                      Comment


                        #12
                        please add my vote

                        Comment


                          #13
                          Hello Mindset,

                          Thank you for your vote.

                          I have added this to SFT-5079.
                          Chelsea B.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by DJ888, Today, 10:57 PM
                          0 responses
                          6 views
                          0 likes
                          Last Post DJ888
                          by DJ888
                           
                          Started by MacDad, 02-25-2024, 11:48 PM
                          7 responses
                          158 views
                          0 likes
                          Last Post loganjarosz123  
                          Started by Belfortbucks, Today, 09:29 PM
                          0 responses
                          7 views
                          0 likes
                          Last Post Belfortbucks  
                          Started by zstheorist, Today, 07:52 PM
                          0 responses
                          7 views
                          0 likes
                          Last Post zstheorist  
                          Started by pmachiraju, 11-01-2023, 04:46 AM
                          8 responses
                          151 views
                          0 likes
                          Last Post rehmans
                          by rehmans
                           
                          Working...
                          X