I cant find a foreach ... ToList() to get to the button. Any help? Thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to access button content in OnBarUpdate
Collapse
X
-
How to access button content in OnBarUpdate
NT8, Strategy, I have buttons in a grid, they work properly when clicked, but in OnBarUpdate I want to change the Content that is displayed, but I get an error saying it is owned by another thread.
I cant find a foreach ... ToList() to get to the button. Any help? Thanks.Tags: None
-
Hello kenz987,
Thank you for your post.
You'd need to use a dispatcher since the button would be on a different thread (OnBarUpdate would be on an instrument thread while buttons would be on a UI thread).
I'd suggest reviewing this section of our help guide on multi-threading considerations with NinjaScript:
https://ninjatrader.com/support/help...-threading.htm
As well as this example that covers making changes to UI elements using WPF modifications:
Hello All, Moving forward this will be maintained in the help guide reference samples and no longer maintained on the forum. Creating Chart WPF (UI) Modifications from an Indicator - https://ninjatrader.com/support/help...ui)-modifi.htm (https://ninjatrader.com/support/helpGuides/nt8/creating-chart-wpf-(ui)-modifi.htm) I've
Please let us know if we may be of further assistance to you.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
63 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
91 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
48 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
105 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
63 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|
Comment