alexmoran
alexmoran

Reputation: 15

Visual Studio | Windows Phone Wait Without Sleep

I was trying to wait 2 seconds before the event in my Windows Phone app. I tried Thread.Sleep but it stopped everything.

I am trying to wait 2 seconds but without blocking the execution of the UI thread.

Upvotes: 1

Views: 41

Answers (1)

Wosi
Wosi

Reputation: 45351

You can await an asynchronous delay with:

await Task.Delay(TimeSpan.FromSeconds(2000));

Upvotes: 2

Related Questions