In WPF all controls inherit DispatcherObject & its easy to get to the Dispatcher.
How would I get the DispatcherQueue using WinUI 3 Windows App SDK and use it in a ViewModel?
EDIT
My implementation which expands on mm8's most appreciated answer.
Create a Property in my ViewModel
public Microsoft.UI.Dispatching.DispatcherQueue TheDispatcher { get; set; }
Then grab the dispatcher in my MainPage.xaml.cs codebehind Constructor
ViewModel.TheDispatcher = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread();
Now I have the dispatcher n my VM so its easy to use from the VM:
TheDispatcher.TryEnqueue(() =>
{
// some ui thread work
});
Note: I didnt post this as an answer as there is one, this is my implementation to help anyone interested.