Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Can NinjaTrader work with WPF windows derived from : Window ?

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

    Can NinjaTrader work with WPF windows derived from : Window ?

    Hello,

    I am trying to build a dashboard outside of the NT environment, but to integrate with NT by subscribing to events, etc. I had a good start, compiled to a dll, tested it with a windows app outside NT, then moved the dll to the custom directory, and referenced it. But it won't compile in NT. I get a null reference exception but have no idea what object is null.

    Next I tried to just put my visual studio project folder code in the custom directory. Deleted the reference to the dll, and the dll itself. NT does see and attempt to compile the code, but I get other errors. Also tried putting the project folder in the AddOns directory. No dice. The last error that is defeating me is this:

    The name 'InitializeComponent' does not exist in the current context

    The InitializeComponent it is talking about is when my windows window (as opposed to an NTWindow) is instantiated. But again, it works fine from my visual studio test application.

    I am wondering if what I am trying to do is even possible. If not, then if I change to a NTWindow as per your documentation, does NT support all the xaml layout and other controls that I have been using in visual studio?

    I personally think it is much easier to build a complex form in VS, and just import it with a DLL in NT, so I hope that option can work.

    Thanks for your help,

    Roger

    #2
    Hello RogBear62,

    This would be outside of what is documented or supported by our Engineering support team.

    You may be able to do this in a custom addon with a separate window. Try modifying the addon example below.


    I wouldn't be able to assist with using the dll.

    As far as I know, InitializeComponent is not going to work. You would need to load the xaml using the demonstration in the Addon Framework NinjaScript Basic.


    using (System.IO.Stream assemblyResourceStream = GetManifestResourceStream()

    Or using a file stream.
    FileStream fs = new FileStream()

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks. I'm attempting to do it your way, and so far, it looks promising. The NT way may turn out better, with fewer issues for me to work through in the end.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      382 views
      0 likes
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      1 view
      0 likes
      Last Post oviejo
      by oviejo
       
      Started by pechtri, 06-22-2023, 02:31 AM
      10 responses
      125 views
      0 likes
      Last Post Leeroy_Jenkins  
      Started by judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Yesterday, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Working...
      X