• 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

How to deliver readable xaml in compiled assembly?

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

    How to deliver readable xaml in compiled assembly?

    I am trying to package a compiled assembly that includes classes in the AddOns directory which have corresponding .xaml files.

    I have tested and verified that these addon classes know how to read their own xaml when the xaml is actually in the [userhomepath]\Custom\AddOns directory.

    I next wanted to make the classes read their own xaml when they are packaged in a .dll.
    I used the export tool to create a compiled assembly. I modified the code to try to read the xaml file using the same technique used in the SampleAddOn classes. It does not work.

    I then packaged the SampleAddOn code into a dll as a test and it also does not read it's own xaml when loading the SampleAddonWindowTabPage class. I have attached the compiled assembly for you to test.

    So here are the questions/comments for improvement:

    1) What is the NinjaTrader approved method for packaging and delivering xaml in a compiled assembly a class with associated xaml file(s).

    2) The SamplAddOn code only demonstrates a class that extends NTTabPage. The code that reads the xaml uses a method on NTTabPage. This implies a restriction on what kinds of classes can load their own xaml files. Why? There should be no restriction on the type of class that needs xaml. My class simple extends UserControl so it can not use the exact technique to read xaml as demonstrated in SampleAddonWindowTabPage.

    3) The Export NinjaScript dialog should list the xaml files so they can be included in the export. As it is now, they are not listed and I am left to guess whether or not it was included. Xaml files can be used in many ways and there should not be a 1 to 1 assumed correspondence between .cs file and .xaml file. I am not absolutely certain that the xaml files were included in the dll in my tests. I used the object browser in VisualStudio and also JetBrains DotPeek and did not see the xml file (but I am not certain these tools are built to show .xaml files).

    Thanks,
    Gary
    Attached Files

    #2
    Hello,

    Is the core issue just the fact that the associated xaml file is not being included in the export? If that's the case, the recommended approach at this time is to export the dll as usual, then manually add your xaml file into the .zip file after the fact. That will ensure that it is included in the zip and placed in the appropriate directory when imported by a user.

    If the issue goes deeper than that, please let me know and I'll take another look.

    We are currently tracking a feature request to list xaml and other files (sounds, etc.) in the Export dialogue itself, so that this manual process can be streamlined and handled entirely through the UI (tracking ID # SFT-968), and I've added another vote to the request on your behalf.
    Dave I.NinjaTrader Product Management

    Comment


      #3
      Manually adding to zip file did not work

      I tried manually adding the xaml file to the zip file and when the zip file was imported, the xaml file was not present.
      Perhaps i did it wrong, so, please explain the steps to manually add a XAML file to an exported zip file so that the import process will put it in the right place.

      But better yet, please fix the export process so that it recognizes xaml and other file types for inclusion in the export, and needless to say, proper placement when the zip file is imported.

      Thanks,
      Gary

      Comment


        #4
        Hello,

        Thank you for the reply. The feature request has been added regarding including xaml files.

        To manually include the file, you would need to follow the same process as adding a template or any other item to the zip after export which is outlined here: http://ninjatrader.com/support/helpG..._procedure.htm

        The process would simply be:
        1. Export zip
        2. Right click on resulting zip file
        3. Select "Open with -> Windows Explorer"
        4. A window should open with the contents of the zip.
        5. Double click the Addons folder, or create the folder that the xaml should reside in
        6. Drag and drop the xaml file into the addons folder or folder you created.
        7. Close the window.



        The resulting zip should now contain the xaml file.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by nepenthean, Today, 12:36 PM
        0 responses
        3 views
        0 likes
        Last Post nepenthean  
        Started by sun0781, Yesterday, 05:02 PM
        1 response
        19 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by Emma1, Today, 12:14 PM
        0 responses
        2 views
        0 likes
        Last Post Emma1
        by Emma1
         
        Started by Hanstanz, Today, 04:44 AM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by Newtrader101, Today, 10:31 AM
        0 responses
        8 views
        0 likes
        Last Post Newtrader101  
        Working...
        X