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
Comment