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.


      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by llanqui, Today, 03:53 AM
      0 responses
      5 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      10 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      15 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Yesterday, 08:42 PM
      0 responses
      11 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Yesterday, 07:51 PM
      0 responses
      14 views
      0 likes
      Last Post strategist007  
      Working...
      X