There's not enough information to give you code for an answer, but in general:
First, realize that async
does not run your code on a background thread. All it does is create a little state machine that enables await
operations. Likewise, await
does not run your code on a background thread.
If you have CPU-intensive operations, you should push them off to a background thread using await Task.Run(..)
. Any kind of data binding is considered a UI operation and should not be done inside a call to Task.Run
.