• 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

Adding Grid from external library to ChartTrader

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

    Adding Grid from external library to ChartTrader

    Hi,

    I am attempting to add a custom grid with some elements to ChartTrader using an indicator. I have created WPF User Control Library in .NET Framework 4.5, changed it to Page and built. Then I have moved the compiled DLL to %username%\Documents\NinjaTrader 8\bin\Custom so I can reference it inside an indicator. The indicator is quite straight forward, it looks for ChartTrader, creates a new row and adds a grid from the external library. There are no errors but the grid doesn't render.

    Please, see the zip file attached for all the files required to replicate the issue.
    Any help much appreciated.

    Regards,
    Jiri
    Attached Files

    #2
    The external library is not obfuscated but for easier access, here is the XAML code:

    Code:
    <Page x:Class="WpfControlLibrary1.UserControl1"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:t="clr-namespace:NinjaTrader.Gui.Tools;assembly=NinjaTrader.Gui"
                 xmlns:system="clr-namespace:System;assembly=mscorlib"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 xmlns:local="clr-namespace:WpfControlLibrary1"
                 mc:Ignorable="d"
                 d:DesignHeight="450" d:DesignWidth="240">
        <Grid>
            <Grid.Resources>
                <Style TargetType="Border">
                    <Setter Property="Padding" Value="0,0,0,6" />
                </Style>
            </Grid.Resources>
    
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="6" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
    
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition Height="30" />
            </Grid.RowDefinitions>
    
            <Border Grid.Row="0" Grid.Column="0">
                <Button Content="Button 1" />
            </Border>
    
            <Border Grid.Row="0" Grid.Column="2">
                <Button Content="Button 2" />
            </Border>
    
            <Border Grid.Row="1" Grid.Column="0">
                <Button Content="Button 3" />
            </Border>
    
            <Border Grid.Row="1" Grid.Column="2">
                <Button Content="Button 4" />
            </Border>
        </Grid>
    </Page>

    Comment


      #3
      Hello Jiri,

      While this custom WPF work would be outside of what is supported by NinjaTrader, I have a few examples you may find helpful.
      http://ninjatrader.com/support/forum...059#post477059
      https://ninjatrader.com/support/foru...686#post492686
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by aviat72, Today, 12:41 AM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Started by _Zero_, 01-06-2020, 01:16 PM
      2 responses
      76 views
      2 likes
      Last Post CiprianV  
      Started by RuthB, 05-29-2020, 09:41 PM
      3 responses
      33 views
      0 likes
      Last Post aviat72
      by aviat72
       
      Started by Jorge.andres.o, Yesterday, 08:22 PM
      0 responses
      7 views
      0 likes
      Last Post Jorge.andres.o  
      Started by mtamaku, Yesterday, 06:54 PM
      0 responses
      11 views
      0 likes
      Last Post mtamaku
      by mtamaku
       
      Working...
      X