Hi folks,
I have a waiting animation spinning and I need to invoke a blocking function, this causes animation to stop.
Apart invoking function in a secondary thread is there any alternative solution/trick I’m not aware of?
Happy holidays!
-Corrado
Nope, you block on the UI thread, animations stop (and I think videos too). Isn't that a perfect use of the ThreadPool (or background worker if you want to be able to cancel it)?
Oh yeah,
That’s probably what I’m going to do, just wanted to ask this club of gurus if i just miss something that could avoid that J
Thanks Shawn!
-Corrado
From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com] On Behalf Of Shawn Wildermuth
Sent: mercoledì 23 dicembre 2009 08:27
To: wpf-di...@googlegroups.com
Subject: RE: [WPF Disciples] Animations and blocking thread
Nope, you block on the UI thread, animations stop (and I think videos too). Isn't that a perfect use of the ThreadPool (or background worker if you want to be able to cancel it)?
From: wpf-di...@googlegroups.com [mailto:wpf-di...@googlegroups.com] On Behalf Of Corrado Cavalli
Sent: Wednesday, December 23, 2009 1:17 AM
To: wpf-di...@googlegroups.com
Subject: [WPF Disciples] Animations and blocking thread
Hi folks,
As others said, threading is the way. Note that some operations in the framework are already asynchronous (such as async web requests) so they are not blocking. Sometimes however I find that the mere operation of creating a web client causes some glitches in the animations, so I sometimes spin a new thread for that operation anyway.
Thankfully, with lambdas, threading is much less painful than it used to be… as long as everything works fine ;)
Cheers,
Laurent