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

Customize DatePicker to look according NT theme

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

    Customize DatePicker to look according NT theme

    Hello

    I develope NT add-on, using example https://ninjatrader.com/support/help...t_overview.htm

    All controls I use behave correctly with exception of DatePicker, it does not change the background color according to the current NT theme (screenshot attached). What shall I do to make it look as other controls?

    DatePicker declaration in XAML:
    <DatePicker x:Name="endDate" Grid.Column="2" Grid.Row="1" VerticalAlignment="Top"/>
    Attached Files

    #2
    Hi,

    i think its possible to load a designtheme to fit your datepicker to the rest of the AddOnFramework, but i don't know how to do that.

    I had the same problem with a datagrid control.
    I solved the styling problem by setting the color on control finding at LoadXAML():

    Add the following code to your LoadXAML()
    PHP Code:
    var yourBrush = new SolidColorBrush(Color.FromRgb((byte)30, (byte)30, (byte)30));
    yourDatePicker.Background Brushes.yourBrush;
    yourDatePicker.Foreground Brushes.White
    Try and tell me if its working.

    GoS

    Comment


      #3
      Setting hard-coded brush does not work because the NT theme may be different: Light Gray, Dark Gray, etc. I need to get access to the background color, which NT uses for the current theme, but I don't know how to do it

      Comment


        #4
        Hello rfsettling,

        I'm looking into this for you and I will let you know what I find.

        I appreciate your patience.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello rfsettling,

          I'm looking into this for you and I will let you know what I find.

          I appreciate your patience.
          Hello,
          is there any progress with it?

          Comment


            #6
            Hello rfsettling,

            I have inquired with our development but I have not received an answer at this time.

            I appreciate your patience.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hello rfsettling,

              Our development has let me know this is a XamDateTimeEditor from the Infragistics library.

              This can be added with XAML:

              Add a namespace:
              Code:
              xmlns:editors="http://infragistics.com/Editors"
              Add the object:
              Code:
              <editors:XamDateTimeEditor Grid.Column="1" Grid.Row="5" HorizontalAlignment="Left" VerticalAlignment="Top" Value="7/12/2017" />
              Or from C#.

              References to InfragisticsWPF4.Editors.v15.1.dll and InfragisticsWPF4.v15.1.dll are necessary.
              Program Files (x86)\NinjaTrader 8\bin\InfragisticsWPF4.Editors.v15.1.dll
              Program Files (x86)\NinjaTrader 8\bin\InfragisticsWPF4.v15.1.dll

              Code:
              Infragistics.Windows.Editors.XamDateTimeEditor dateTimeEditor = new Infragistics.Windows.Editors.XamDateTimeEditor()
              {
              	Value = DateTime.Now
              };
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Sparkyboy, Today, 10:57 AM
              0 responses
              0 views
              0 likes
              Last Post Sparkyboy  
              Started by TheMarlin801, 10-13-2020, 01:40 AM
              21 responses
              3,916 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by timmbbo, 07-05-2023, 10:21 PM
              3 responses
              151 views
              0 likes
              Last Post grayfrog  
              Started by Lumbeezl, 01-11-2022, 06:50 PM
              30 responses
              808 views
              1 like
              Last Post grayfrog  
              Started by xiinteractive, 04-09-2024, 08:08 AM
              3 responses
              11 views
              0 likes
              Last Post NinjaTrader_Erick  
              Working...
              X