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 Jimmyk, 01-26-2018, 05:19 AM
        8 responses
        863 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by giulyko00, 04-24-2024, 12:03 PM
        6 responses
        29 views
        0 likes
        Last Post giulyko00  
        Started by 00nevest, 04-27-2024, 02:27 PM
        3 responses
        27 views
        0 likes
        Last Post 00nevest  
        Started by Newtrader101, Today, 07:36 AM
        0 responses
        4 views
        0 likes
        Last Post Newtrader101  
        Started by 21laienoch, Today, 07:25 AM
        0 responses
        7 views
        0 likes
        Last Post 21laienoch  
        Working...
        X