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 Pattontje, Yesterday, 02:10 PM
      2 responses
      15 views
      0 likes
      Last Post Pattontje  
      Started by flybuzz, 04-21-2024, 04:07 PM
      17 responses
      229 views
      0 likes
      Last Post TradingLoss  
      Started by agclub, 04-21-2024, 08:57 PM
      3 responses
      17 views
      0 likes
      Last Post TradingLoss  
      Started by TradingLoss, 04-21-2024, 04:32 PM
      4 responses
      44 views
      2 likes
      Last Post TradingLoss  
      Started by cre8able, 04-17-2024, 04:16 PM
      6 responses
      57 views
      0 likes
      Last Post cre8able  
      Working...
      X