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

Visual Studio Sample/Gui Develop

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

    Visual Studio Sample/Gui Develop

    Hello !

    I want to build an AddOn to create a DOM similar to a plataform that i already use in my country that have some usefull functions.

    Started downloading the sample from here: https://ninjatrader.com/support/help...us/?editor.htm / NinjaTraderAddOnProject.zip

    But this sample has a problem: Unhandled exception: 'Set connectionId threw an exception' Line number 7 and line position 3



    After some search i have found that should do some changes using the code from NinjaEditor version: https://ninjatrader.com/support/foru...t=connectionId

    But i think just changing the code is not possible, the XAML files are way different one from another.
    Has anyone managed to use the Visual Studio solution ?

    About the GUI development: is possible to use XAML designer editor from VS, or any other editor ?
    And to debug: i tryied to debug the code using the attach method. in the docs is said that DebugMode should be activated in NinjaEditor, but how to do that in VS ?
    I tried just to attach, but VS hangs at some random point.

    Thanks !!
    Last edited by JulianoFL; 03-15-2018, 10:36 AM.

    #2
    Hello JulianoFL,

    Thanks for writing in.

    I'm currently investigating your inquiry and I will reach back with a complete answer of my findings.

    Thanks in advance for your patience.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello JulianoFL,

      Thanks for your patience.

      Could you let me know if you encounter the issue with the attached version of the Visual Studio project?

      If you are could you tell us exactly what you are doing to hit the error?

      The XAML editor can be used in VisualStudio, however the XAML editor may not be aware of the custom NinjaTrader Controls that we have documented here.
      We would not support XAML editing with a GUI because of this.

      Debug Mode must be enabled in the NinjaScript Editor before Visual Studio can be attached to NinjaTrader.exe. If you follow the steps outlined in the help guide, you should be able to attach the debugger and apply breakpoints without issue.

      Debugging with Visual Studio - https://ninjatrader.com/support/help..._debugging.htm

      If you run into any specific issues, please let us know and we will be happy to work with you further.
      Last edited by NinjaTrader_Jim; 03-16-2018, 09:40 AM.
      JimNinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_Jim View Post
        Hello JulianoFL,

        Thanks for your patience.

        Could you let me know if you encounter the issue with the attached version of the Visual Studio project?

        If you are could you tell us exactly what you are doing to hit the error?

        The XAML editor can be used in VisualStudio, however the XAML editor may not be aware of the custom NinjaTrader Controls that we have documented here.
        We would not support XAML editing with a GUI because of this.

        Debug Mode must be enabled in the NinjaScript Editor before Visual Studio can be attached to NinjaTrader.exe. If you follow the steps outlined in the help guide, you should be able to attach the debugger and apply breakpoints without issue.

        Debugging with Visual Studio - https://ninjatrader.com/support/help..._debugging.htm

        If you run into any specific issues, please let us know and we will be happy to work with you further.

        Hello,

        I tried the code. It compiles without problems, but the AddOn has a blank window with a NewTab.

        Then after reading the code i found the line: AddOnPage - System.IO.Stream assemblyResourceStream = GetManifestResourceStream("AddOns.AddOnFrameworkTa b.xaml")) (I don't know whe the forum is putting a space in Tab)

        It loads the XAML to memory right ? But is the XAML path right ?
        After debugging, the line Page page = System.Windows.Markup.XamlReader.Load(streamReader .BaseStream) as Page - raises System.Windows.Markup.XamlParseException: 'Data at the root level is invalid. Line 1, position 1.'

        I tried to change the line to GetManifestResourceStream("AddOns.AddOnPage.xaml") but it returns null;
        Tried to change the XAML file type, instead of t:NTTabpage to Page, but a lot of errors raises.

        Any help is apreciated,

        Thanks !
        Last edited by JulianoFL; 03-15-2018, 06:58 PM.

        Comment


          #5
          Hello JulianoFL,

          I had copied over code from the NinjaScript Editor version that loads the XAML from the NinjaTrader 8/bin/Custom/AddOns folder. I had overlooked the blank page issue, because I had the XAML file in that directory.

          The version attached will load the XAML from the DLL.

          If you hit any exceptions with this version, please let us know how we can hit them so we can look into the matter further.
          Attached Files
          JimNinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_Jim View Post
            Hello JulianoFL,

            I had copied over code from the NinjaScript Editor version that loads the XAML from the NinjaTrader 8/bin/Custom/AddOns folder. I had overlooked the blank page issue, because I had the XAML file in that directory.

            The version attached will load the XAML from the DLL.

            If you hit any exceptions with this version, please let us know how we can hit them so we can look into the matter further.
            Worked like cham now.
            Thank you for your help.

            Tip: For anyone wanting to use VS + Ninja, go to debug options and change action type to external program. Way easier to debug this way.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Christopher_R, Today, 12:29 AM
            0 responses
            8 views
            0 likes
            Last Post Christopher_R  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            166 responses
            2,235 views
            0 likes
            Last Post sidlercom80  
            Started by thread, Yesterday, 11:58 PM
            0 responses
            3 views
            0 likes
            Last Post thread
            by thread
             
            Started by jclose, Yesterday, 09:37 PM
            0 responses
            7 views
            0 likes
            Last Post jclose
            by jclose
             
            Started by WeyldFalcon, 08-07-2020, 06:13 AM
            10 responses
            1,415 views
            0 likes
            Last Post Traderontheroad  
            Working...
            X