Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sharing properties with other classes

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

    Sharing properties with other classes

    Hello! Had a quick question regarding properties and how to share them.

    Example

    Indicator A
    Code:
    default properties....
    testInt = 5;
    
    #region properties...
    [Range(0, int.MaxValue)]
    [NinjaScriptProperty]
    
    public int testInt
    
    { get; set; }
    Addon Class X

    Code:
    somefunction(){
    if(testInt <2)
    }
    I realized that I could just drill down testInt in somefunction(testInt) from the indicator. I was hoping not to do that since i'm going to have a lot of different properties.

    My first thought was to create a static class "Config" and set the values in the config class to the property value. This is not working though. Granted i'm not the best at c#. More of a JS dev.

    any suggestions here would be appreciated!

    #2
    Hello jaboo,

    Thanks for your post.

    Can you clarify what your specific goal is?

    Are you making an add-on and want indicator properties?

    Or are you trying to share properties with indicators/

    feel free to add further clarifying information.

    Comment


      #3
      Thanks. I just puit it in configure state and every worked as intended.

      but yes, I just wanted to share the properties with another class.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      666 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      377 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      110 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      575 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      580 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X