Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Thread.Sleep() without freezing the UI

private void someMethod()
  TO
 private async void someMethod()
 await Task.Delay(milliseconds);

This makes it an asynchronous method and will run asynchronously from your UI thread.
Note that this is only supported in the Microsoft .NET framework 4.5 and higher.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #freezing #UI
ADD COMMENT
Topic
Name
8+2 =