Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hidding a brush from the indicator properties dialog.

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

    Hidding a brush from the indicator properties dialog.

    Hello!
    I have successfully rendered a text. The idea is to prevent the user of changing the color oft he text. In OnBarupdate(), I would have done the following: myColor = Brushes.Green;
    But OnRender() does not accept this declaration/initialization.
    In the section properties, I have the following code:

    HTML Code:
    [XmlIgnore]
    [Display(Name = "MyColor", GroupName = "Parameters")]
    public Brush MyColorBrush
    {
       get { return myColorBrush; }
       set { myColorBrush = value; }
    }
    
    [Browsable(false)]
    public string MyColorBrushSerialize
    {
        get { return Serialize.BrushToString(MyColorBrush); }
        set { MyColorBrush = Serialize.StringToBrush(value); }
    }​


    Is it possible of rendering a text and preventing the text color of being changed? If yes, could one please guides me here?

    Best regards

    #2
    Hello Stanfillirenfro,

    You can add Browsable(false) like you have on the other property to hide that from the UI as well. In that situation you could just use a private variable since it won't be configurable.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Many thanks NinjaTrader_Jesse for your reply.

      Awsome! Problem solved!

      Thanks again!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by MitolynBest, Today, 09:47 AM
      0 responses
      2 views
      0 likes
      Last Post MitolynBest  
      Started by siddhugaddi, 12-29-2024, 11:38 AM
      5 responses
      45 views
      0 likes
      Last Post Herry
      by Herry
       
      Started by firstlanetech, 12-06-2024, 11:31 PM
      3 responses
      32 views
      0 likes
      Last Post Herry
      by Herry
       
      Started by manitshah915, 12-12-2024, 09:39 AM
      2 responses
      52 views
      0 likes
      Last Post Herry
      by Herry
       
      Started by ntsomeone, Today, 07:47 AM
      0 responses
      8 views
      0 likes
      Last Post ntsomeone  
      Working...
      X