https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?using_a_typeconverter_to_custo.htm
shows some examples on how to customize the property grid. in particular I am referring to those where the attribute PropertyEditorAttribute is used:
[TypeConverter(typeof(FriendlyBoolConverter))] // Converts the bool to string values [PropertyEditor("NinjaTrader.Gui.Tools.StringStandardValuesEditorKey")] // Create the combo box on the property grid [Display(Name = "Friendly bool", Order = 1, GroupName = "Use Case #3")] public bool FriendlyBool { get; set; } [TypeConverter(typeof(FriendlyEnumConverter))] // Converts the enum to string values [PropertyEditor("NinjaTrader.Gui.Tools.StringStandardValuesEditorKey")] // Enums normally automatically get a combo box, but we need to apply this specific editor so default value is automatically selected [Display(Name = "Friendly Enum", Order = 8, GroupName = "Use Case #4")] public MyEnum EnumValue { get; set; } // Note: All these DisplayAttribute properties are required // Prompt is used to set what displays in the property grid and during mouseover [XmlIgnore] [Display(Name = "List values", GroupName = "Use Case #5", Order = 9, Prompt = "1 value|{0} values|Add value...|Edit value...|Edit values...")] [PropertyEditor("NinjaTrader.Gui.Tools.CollectionEditor")] // Allows a pop-up to be used to add values to the collection, similar to Price Levels in Drawing Tools [SkipOnCopyTo(true)] public Collection<PercentWrapper> MyListValues { get { return myListValues; } set { myListValues = new Collection<PercentWrapper>(value.ToList()); } }
By analysing the code and introspecting assemblies with VS Object Browser and ILSpy, I inferred that the attribute allows to assign to a property an editor different from the default one.
This seems to be based on the Infragistics WpfPropertyGrid custom control.
However, the custom editors used in the examples are classes in the NinjaTrader.Gui.Tools namespace.
What I want to do is to develop custom WPF controls and use them as editor for properties in custom indicators/strategies.
For example, I could have a complex custom strategy parameter (not a simple string, boolean, number or enum), and I would like to see a button in the property grid. Clicking on that button, a WPF dialog would open, allowing the user to view/edit in a custom way the value of the property.
It seems that all the available editors in NinjaTrader.Gui.Tools are inheriting from
Is it possible to simply use a natural local WPF control with visual studio (https://learn.microsoft.com/en-us/do...orkdesktop-4.8) and then make NinjaTrader use it for a property when showing the property grid of an indicator or strategy?
I know that another way could be writing an AddOn, however if what I am asking was possible it would be much easier to implement.