Reputation: 10672
I am looking for the way to sleep the dispatcher thread but didn't found any way. I know there is 'this.Dispatcher.Thread' but I don't think i.e what I am looking for because it doesn't have sleep().
this.Dispatcher.BeginInvoke(new Action(() =>
{
//Thread.Sleep
}));
Upvotes: 1
Views: 796
Reputation: 19416
When you use Thread.Sleep
it sleeps the current thread, so when you do the following:
this.Dispatcher.BeginInvoke(new Action(() => Thread.Sleep(1000)));
It will sleep and freeze the UI thread for 1 second.
I strongly advise against this, however it should answer your question.
Upvotes: 1