This question is locked. New answers and comments are not allowed.
Hi,
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.
Model:
Is there any other way of updating the ObservableCollection from a non-ui thread, that doesn't ?
Thank you
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.
Model:
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