I\'m supposed to be able to access the Dispatcher that belongs to the View I need to pass it to the ViewModel. But the View should not know anything about the ViewModel, so
I get the ViewModel to store the current dispatcher as a member.
If the ViewModel is created by the view, you know that the current dispatcher at creation time will be the View's dispatcher.
class MyViewModel
{
readonly Dispatcher _dispatcher;
public MyViewModel()
{
_dispatcher = Dispatcher.CurrentDispatcher;
}
}