I am trying to update a progressbar using the dispatcher but somehow cannot think where to place the dispatcher.Invoke and what to pass inside it.
Im trying to impor
I am assuming that you've started a background thread to import the files. You should consider using BackgroundWorker for this, which is lightweight and has a mechanism built in to report progress (e.g., a ProgressBar) using an event.
If you want to use a new thread, anywhere within the processing that you are doing, just declare a delegate, add a function to target, and call Dispatcher.BeginInvoke:
Dispatcher.BeginInvoke(DispatcherPriority.Normal, new UpdateProgressDelegate(UpdateProgress), myProgressData);
//...
private delegate void UpdateProgressDelegate(ProgressClass progressClass);
void UpdateProgress(ProgressClass progressClass)
{
progressbar.updateprogress(progressclass);
progressbar.show();
}