My question is quite simple I have a class which contains a (private) object of type ObservableCollection<T> and now I’d like to run some threads (in sequence, thus the ThreadPool and not BackgroundWorkers) which add new items to the ObservableCollection<T>.
If the ObservableCollection<T> would be, let’s say, a ProgressBar, all would be quite easy (-> Invoke) but I have no idea how to invoke the ObservableCollection<T> object.
My goal is to have something like a BackgroundWorker which can be run sequence.
Thank you in advance.
I recommend using
Taskobjects for the background operations and queueing updates to the UI thread usingTaskScheduler.FromCurrentSynchronizationContext.