Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issues displaying real time data in a XAML textbox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Issues displaying real time data in a XAML textbox

    Hello NT team,
    I was wondering if you could help me out to clarify how to display real time values from an indicator to a XAML textbox in an Addon.
    I have an indicator that reads values from an account, these values are then shared with an addon via a Property. This is working fine, the updated values from the indicator are available within the addon.
    The addon has a XAML textbox that should display the values every time they change. To do that I have implemented two ways:
    1. A buttonclick() method, when clicked, a string variable linked to the XAML textbox is assigned the updated value, and then displayed in the textbox. That´s working fine.
    2. The Property in the Addon also has registered an event that triggers every time the values change in the indicator, these values are assigned to the same string variable of the XAML textbox. I was expecting the updated value to appear automatically in the textbox, but it doesn´t do it. The event trigger of the Addon works because I see the updated values in the output window by doing a PrintTo.OutputTab1. However, I cannot make that same value to show in the XAML textbox. It only shows in the textbox when pressing the button (point 1 above).
    I thought of an explanation that the XAML textbox runs in a different thread, when the button is pressed the system would give it priority and displays the updated value in the textbox, however that´s not happening with a registered event (point 2 above) because of perhaps I have to consider threading? Then, I used Dispatcher.InvokeAsync inside the event trigger method and assign the updated value already available to the string variable of the textbox, but still does not work and nothing is shown in the textbox.

    Can you give me some guidance of what could be the issue and have a working example that I can have a look at?
    Many thanks!


    #2
    Hello juartur,

    Once the xaml is parsed the objects are created as WPF objects.

    The window dispatcher should be used (with an InvokeAsync) to modify the UI thread from the Account thread.

    I've modified the AddonShell to demonstrate.
    AccountAddonTest_NT8.zip
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      It works now! your example clarified it all, "this." in front of Dispatcher made the trick

      Thanks a lot!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      626 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      359 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      562 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      567 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X