The code still runs in the user interface thread.
It does not work in the background thread.
, , , - .
Thread.Sleep .
, async await.
await :
. - , await. - , .
, , , await Task.Delay(5000);. " 5 " " , ". , .
5 .
, , -, , , , .
, ?
Task.Run.
, , .
, await :
Life of method: <------------------------------------------------------->
Parts: [ start of method ----][awaitable][ rest of method -----]
, , await X, , X , , Task , awaitable , " " .
X , , -, , , await .
, . , ( ) , .
, " ", , , " " , ( ) .
await , , , .
Task, .NET. async/await , , , .