EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

Dispatcher Class

May 11, 2014

Provides services for managing the queue of work items for a thread.

System.Object
  System.Windows.Threading.Dispatcher

Namespace:  System.Windows.Threading
Assembly:  System.Windows (in System.Windows.dll)

'Déclaration
<CLSCompliantAttribute(True)> _
Public NotInheritable Class Dispatcher

The Dispatcher type exposes the following members.

  NameDescription
Public methodBeginInvoke(Action)Executes the specified delegate asynchronously on the thread the Dispatcher is associated with.
Public methodBeginInvoke(Delegate, Object())Executes the specified delegate asynchronously with the specified array of arguments on the thread the Dispatcher is associated with.
Public methodCheckAccessDetermines whether the calling thread is the thread associated with this Dispatcher.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The Dispatcher class currently provides support only for running code on the user interface (UI) thread from a non-UI thread. For example, you could update the UI after the device camera finishes capturing a photo. For more information about this scenario, see How to create a base camera app for Windows Phone 8.

You can access the Dispatcher object for the UI thread through the DependencyObject.Dispatcher properties. These are instance methods, but instances of these types are frequently inaccessible from non-UI threads.

You can call the CheckAccess method to determine whether the caller is on the UI thread. If the caller is not on the UI thread, you can call BeginInvoke to run the specified delegate on the UI thread.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Afficher:
© 2014 Microsoft