Disables processing of the Dispatcher queue.
Assembly: WindowsBase (in WindowsBase.dll)
Disabling dispatcher processing is an advanced method that is intended to eliminate the chance of unrelated reentrancy.
The effects of disabling processing are as follows:
CLR locks will not pump messages internally.
DispatcherFrame objects are not allowed to be pushed.
Message processing is not permitted.
The DispatcherProcessingDisabled structure that returns when it is called can be used to re-enable dispatcher processing. Calling Dispose on the DispatcherProcessingDisabled structure re-enables processing.
can only be called on the thread the Dispatcher is associated with.
The following example shows how to disable dispatcher processing and re-enable dispatcher processing. is called in a using statement. returns a DispatcherProcessingDisabled structure that is used as the object to be disposed when the using block finishes. When Dispose is called on the DispatcherProcessingDisabled structure, dispatcher processing is re-enabled.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.