Real time data from non UI-Thread

3 posts, 0 answers
  1. Eduardo
    Eduardo avatar
    1 posts
    Member since:
    Apr 2013

    Posted 30 Apr 2013 Link to this post

    I'm working on a App that is constantly getting live data, but I'm not sure how to bind this to a Chart. I obtain the data from a model class over a Non-UI thread. I tried creating an observable collection which is updated every time I get new data, but since the data is modified on a non-ui thread, I start getting some exceptions. I solved it by surrounding the code that adds data with a dispatcher call, but then result is not a fluid live chart, but one that update itself in steps.

    ObservableCollection<Log> dataList;
    private void onDataReceived(double receivedData)
    Deployment.Current.Dispatcher.BeginInvoke( () => 
      dataList.add(new Log(receivedData)); 

    Is there any other way of updating the ObservableCollection from a non-ui thread, that doesn't ?

    Thank you
  2. Victor
    Victor avatar
    1349 posts

    Posted 02 May 2013 Link to this post

    Hello Eduardo,

    Thanks for the question.
    I am afraid that this is the only way to update the UI thread without causing cross thread exceptions. Dispatcher is the only API that Silverlight provides.

    All the best,
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Erquan
    Erquan avatar
    1 posts
    Member since:
    May 2013

    Posted 08 May 2013 Link to this post

    Hi there, i saw your post said that you are working on app with constantly getting live data. Do you mind to share how you implement this? Is it something similar to Signalr Helper? 
Back to Top