Task​Extensions.​Dispatcher​Operation​Wait Method

Definition

Overloads

Dispatcher​Operation​Wait(​Task)

Waits indefinitely for the underlying DispatcherOperation to complete.

Dispatcher​Operation​Wait(​Task, ​Time​Span)

Waits for the specified amount of time for the underlying DispatcherOperation to complete.

DispatcherOperationWait(Task)

Waits indefinitely for the underlying DispatcherOperation to complete.

public static System.Windows.Threading.DispatcherOperationStatus DispatcherOperationWait (this System.Threading.Tasks.Task this);
Parameters
this
Task

The Task that is associated with the DispatcherOperation.

Returns

The status of the underlying DispatcherOperation.

Exceptions

The Task is not associated with a DispatcherOperation.

Remarks

Call the IsDispatcherOperationTask method to check whether the Task is associated with a DispatcherOperation before you call this method.

DispatcherOperationWait(Task, TimeSpan)

Waits for the specified amount of time for the underlying DispatcherOperation to complete.

public static System.Windows.Threading.DispatcherOperationStatus DispatcherOperationWait (this System.Threading.Tasks.Task this, TimeSpan timeout);
Parameters
this
Task

The Task that is associated with the DispatcherOperation.

timeout
TimeSpan

The amount of time to wait.

Returns

The status of the underlying DispatcherOperation.

Exceptions

The Task is not associated with a DispatcherOperation.

Remarks

Call the IsDispatcherOperationTask method to check whether the Task is associated with a DispatcherOperation before you call this method.