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 yertle, Today, 08:38 AM
      6 responses
      24 views
      0 likes
      Last Post ryjoga
      by ryjoga
       
      Started by algospoke, Yesterday, 06:40 PM
      2 responses
      24 views
      0 likes
      Last Post algospoke  
      Started by ghoul, Today, 06:02 PM
      3 responses
      15 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      46 views
      0 likes
      Last Post jeronymite  
      Started by Barry Milan, Yesterday, 10:35 PM
      7 responses
      23 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X