I have an app with some background threads (actually an in-proc WCF-Service). Each thread runs its own Dispatcher to use some WPF-classes (MediaPlayer-objects to process some audio/video-files; it queues some delegates with BeginInvoke and finally call Dispatcher.Run). When the processing is done, I want to shutdown its dispatcher so that the thread can finish. A call to BeginInvokeShutdown shutdowns every dispatcher in the app, which results in closing the app.
Is there anything I can do, so the dispatcher finishes the message loop?