Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

with custom brush Serialized in UI, does one need to freeze it as well?

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

    with custom brush Serialized in UI, does one need to freeze it as well?

    if color will only be updated under the props window, do you need to use the freeze command as well inside the script?
    it isn't clear from the resource page " Working with Brushes", first it reads the Freeze is needed , and I can see why,
    but the next section then explains how to use Serialization , to move color changes into the UI, but doesn't make any reference to the section above,
    and if they are mutually exclusive, or both needed, or what.
    some clarity on this point would make the reference materials clearer, for us novices

    #2
    PART 2
    When color is serialized, I haven't seen anyone set the default color as well.
    Where is the best place to set the default color, , while still having it available in the UI?
    In the OnStateChange? like SetDefaults or DataLoaded?

    Thanks

    Comment


      #3
      Hello derslyr1,

      The point of freezing a brush is so that it is finalized and made unchangeable.

      Below is a link to the Microsoft documentation.


      For a custom brush created with new SolidColorBrush(), this should be frozen after all of the attributes are set.

      Below is a link to the Working with Brushes page in the help guide.


      A public brush variable used as an input, is not the same as an object value that is assigned to that variable.

      Defaults objects and properties are set in OnStateChange() when State is State.SetDefaults.

      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Thanks Im just not well enough versed in the C# world

        Comment

        Latest Posts

        Collapse

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