• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 jamarc, Today, 02:30 AM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by uday12, Yesterday, 04:19 PM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_PaulH  
              Started by grose, Today, 06:53 AM
              2 responses
              7 views
              0 likes
              Last Post grose
              by grose
               
              Started by Bobisam, Yesterday, 04:57 PM
              1 response
              21 views
              0 likes
              Last Post NinjaTrader_PaulH  
              Started by voltlon, Yesterday, 05:18 PM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_PaulH  
              Working...
              X