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 Jon17, Today, 04:33 PM
      0 responses
      1 view
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      4 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Started by alifarahani, Today, 09:40 AM
      6 responses
      41 views
      0 likes
      Last Post alifarahani  
      Started by Waxavi, Today, 02:10 AM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Working...
      X