Skip to main content
.NET Framework Class Library
DispatcherObject Class

Represents an object that is associated with a Dispatcher.

Inheritance Hierarchy
SystemObject
  System.Windows.ThreadingDispatcherObject
    More...

Namespace:   System.Windows.Threading
Assembly:  WindowsBase (in WindowsBase.dll)
Syntax
Public MustInherit Class DispatcherObject
public abstract class DispatcherObject
public ref class DispatcherObject abstract
[<[%$TOPIC/ms615925_en-us_VS_110_3_0_3_0_0%]>]
type DispatcherObject =  class end

The DispatcherObject type exposes the following members.

Constructors
  NameDescription
Protected method DispatcherObjectInitializes a new instance of the DispatcherObject class.
Top
Properties
  NameDescription
Public property DispatcherGets the Dispatcher this DispatcherObject is associated with.
Top
Methods
  NameDescription
Public method CheckAccessDetermines whether the calling thread has access to this DispatcherObject.
Public method Equals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCodeServes as the default hash function. (Inherited from Object.)
Public method GetTypeGets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public method ToStringReturns a string that represents the current object. (Inherited from Object.)
Public method VerifyAccessEnforces that the calling thread has access to this DispatcherObject.
Top
Remarks

Only the thread that the Dispatcher was created on may access the DispatcherObject directly. To access a DispatcherObject from a thread other than the thread the DispatcherObject was created on, call Invoke or BeginInvoke on the Dispatcher the DispatcherObject is associated with.

Subclasses of DispatcherObject that need to enforce thread safety can do so by calling VerifyAccess on all public methods. This guarantees the calling thread is the thread that the DispatcherObject was created on.

A DispatcherObject cannot be independently instantiated; that is, all constructors are protected.

Objects that derive from DispatcherObject have thread affinity.

Objects that derive from Freezable are free-threaded when they are frozen. For more information, see the Freezable Objects Overview.

Version Information

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Thread Safety

Any public static members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

This object can be accessed only from the thread on which it was created. Attempts to access it from other threads will throw an InvalidOperationException. Invoke or BeginInvoke provide support for marshalling work to the correct thread.