From the documentation of CurrentDispatcher :
Gets the dispatcher for the current thread and creates a new dispatcher if it is not already associated with the stream.
It looks like you are accessing the CurrentDispatcher , and not your user interface thread, and calling your operation on it (i.e., Invoke has no effect, because there is no Dispatcher in the thread you are in; it is created in place, and the call goes to him).
You must store the Dispatcher.CurrentDispatcher value in the place where you create the Client instances (assuming you do this from the user interface thread), for example:
class Client { Client() { this.OwningDispatcher = Dispatcher.CurrentDispatcher; } Dispatcher OwningDispatcher { get; private set; } }
If your Client instances are not created in the UI thread, you need to somehow get the correct Dispatcher value for them.
source share