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

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 MacDad, 02-25-2024, 11:48 PM
        7 responses
        157 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Today, 09:29 PM
        0 responses
        6 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
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        6 views
        0 likes
        Last Post mattbsea  
        Working...
        X