I'm currently working on developing a custom add-on for NinjaTrader and have encountered a situation where I need more control over certain UI elements than the platform seems to natively allow. Specifically, I'm looking to programmatically interact with button controls in a way that goes beyond the exposed methods and properties.
One particular challenge is dealing with the IsPressed property of button elements, which, as per standard WPF behavior, is read-only. This property indicates whether the button is currently being pressed down by the user. My project requires a level of automation that simulates user interactions with these buttons, but without direct user input.
I understand that modifying read-only properties or extending the default behavior of UI elements can lead to potential issues, including maintenance and compatibility concerns. However, my use case presents a unique requirement that I believe might necessitate such an approach.
Could anyone provide guidance or share experience on the following points?
- Framework Extensibility: Does NinjaTrader offer any extensibility features or APIs that allow for more granular control over UI element properties, specifically for overriding or extending the behavior of read-only properties like IsPressed?
- Custom Control Development: Is it advisable or even possible within the NinjaTrader development environment to create custom controls that inherit from standard controls but offer extended functionality, such as a button control with a programmable IsPressed state?
- Best Practices: If anyone has tackled similar challenges, what are the recommended best practices to ensure that any such modifications maintain compatibility with NinjaTrader updates and adhere to sound software development principles?
- Alternative Approaches: If direct modification of read-only properties is not recommended or possible, what alternative approaches could be considered for simulating user interactions with UI elements in an automated manner?
I appreciate any insights, suggestions, or references to documentation that the community or the NinjaTrader team can provide. My goal is to develop this add-on in a way that is both functional for my needs and respectful of the platform's design and ecosystem.
Thank you in advance for your support and guidance.
Best regards,
Aviram Y.
Comment