What is a common real life use for Dispatcher.DisableProcessing in WPF? Can I use it to suspend rendering and layout when I build a complex UI in code?
+2
A:
As per MSDN:
Disabling dispatcher processing is an advanced method that is intended to eliminate the chance of unrelated reentrancy.
So you're doing some work on the same thread the Dispatcher
is executing on, but you don't want it processing events whilst you do that work. I think the really pertinent point is:
The effects of disabling processing are as follows:
* CLR locks will not pump messages internally.
If I understand this correctly, it means that you can safely lock and not have the dispatcher pump events as a result (which might cause undesired reentrancy).
HTH, Kent
Kent Boogaart
2009-01-05 15:28:36
Maybe that is just a language problem but what is a reentrancy?
bitbonk
2010-03-17 21:00:49