Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DispatcherOperation(TResult) Class

DispatcherOperation<TResult> Class

.NET Framework 4.6 and 4.5

Represents an object that is used to interact with an operation that has been posted to the Dispatcher queue and contains a Task<TResult>.


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

public class DispatcherOperation<TResult> : DispatcherOperation

Type Parameters


The type that is returned by the Task<TResult>.

The DispatcherOperation<TResult> type exposes the following members.

Public propertyDispatcherGets the Dispatcher that the operation was posted to. (Inherited from DispatcherOperation.)
Public propertyPriorityGets or sets the priority of the operation in the Dispatcher queue. (Inherited from DispatcherOperation.)
Public propertyResultGets the result of the operation after it has completed.
Public propertyStatusGets the current status of the operation.. (Inherited from DispatcherOperation.)
Public propertyTaskGets a Task that represents the current operation.

Public methodAbortAborts the operation. (Inherited from DispatcherOperation.)
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 it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetAwaiterReturns an object that awaits an asynchronous operation that returns a result.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodInvokeDelegateCoreBegins the operation that is associated with this DispatcherOperation. (Overrides DispatcherOperation.InvokeDelegateCore().)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodWait()Waits for the operation to complete (Inherited from DispatcherOperation.)
Public methodWait(TimeSpan)Waits for the operation to complete in the specified period of time. (Inherited from DispatcherOperation.)

Public eventAbortedOccurs when the operation is aborted. (Inherited from DispatcherOperation.)
Public eventCompletedOccurs when the operation has completed. (Inherited from DispatcherOperation.)

.NET Framework

Supported in: 4.6, 4.5

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