I am in the process of developing an Add-On, and want to do some input validation that is consistent with NT, so I was experimenting to see how you guys have implemented it and in the process came across the following unhandled exception:
Replicate Steps:
- Start NinjaTrader 8.
- Click on the Workspaces menu on the Control Window and click on the "new" button.
- The New Workspace dialogue will open with a default value of "Untitled1". Delete this value and then press the "OK" button.
- This will cause a tooltip to appear with the error message.
- Click in the TextBox and the tooltip will disappear.
- Now move the mouse cursor out of the TextBox and then back over it. This will generate the unhandled exception.
See attached pic.
Interestingly.... as I continued my investigations I set a break point in an Add-On I wrote in the OnWindowCreated event and inspected the New Workspace window instance in the VS Watch Window and located the TextBox and attempted to serialize the TextBox.Style instance into XAML as I have done successfully with a number of other controls to see what you have done style and templating, in this case to see the Control Template for validation.
When I did this I get the following error:
"Initialization of 'System.Windows.Controls.AdornedElementPlaceholder ' threw an exception."
This exception has an inner exception of:
"Can only use AdornedElementPlaceholder as part of Template."
I wondered if this was linked to the issue with the Validation Tooltip.... and so thought it might be worth posting.
Regards,
codeowl
Comment