I have a situation where I am showing a Window
which acts as a splash screen. This window is created on a separate thread from the main ui thread and as such it is associated with its own Dispatcher
(i.e. I end up with 2 Dispatchers the Main Ui dispatcher and the "Splash" Dispatcher
).
When I close the splash window the Dispatcher
associated with the splash window's thread shuts down (though the thread is still running, which is what I want); however, I would like to be able to show the splash window again at a later time on the same thread. The problem I face is the second time I try and do this the Dispatcher
complains that it has been shut down.
Is there a way to force a new Dispatcher
to be associated with a thread which previously had a Dispatcher
associated with it?
Or is there a way to cause the Dispatcher
not to shutdown when the window is closed?
I am aware I could solve this issue by creating a new thread, but I really would prefer not to do this. Ideally I want to have one dedicated thread which is responsible for out of band notifications like the splash and popup "toasters".
NOTE: I've posted the relevant code at this gist: https://gist.github.com/DamianReeves/76771a031f05a8be042d