eomer
eomer

Reputation: 3594

win 8 app multi threading

I have an win8 app and I want to add proggress ring while app gets info from server. but when proggressRing.isActivate = true; checkServer();

the app freezes until returns from checkServer() and proggressRing does not activates when it freezes. I asked around and said you have to use multi threading how can I use multi thread in c# or is there any other way? thanks

Upvotes: 0

Views: 284

Answers (1)

Hermit Dave
Hermit Dave

Reputation: 3046

There are multiple solutions to this 1) first ensure that CheckServer is implemented as Async Task (Async Event based can still be used).

2) If it is CPU intensive operation, use Task.Run to queue the Task to run on a threadpool thread.

have a look at this post http://msdn.microsoft.com/en-us/library/windows/apps/hh452713.aspx and this one http://msdn.microsoft.com/en-us/library/vstudio/hh191443.aspx

Upvotes: 2

Related Questions