• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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, 09: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, 08: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, 05: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 priceisking, Today, 05:33 PM
            0 responses
            3 views
            0 likes
            Last Post priceisking  
            Started by vivekniwas, Today, 02:15 PM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by fibbee, Today, 02:06 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Tyler  
            Started by Spaggetti Ninjja, Today, 01:23 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_PatrickG  
            Started by rexsole, Today, 12:34 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_PatrickG  
            Working...
            X