TaskExtensions.DispatcherOperationWait Method

Definition

Waits for the underlying DispatcherOperation to complete.

Overloads

DispatcherOperationWait(Task)

Waits indefinitely for the underlying DispatcherOperation to complete.

DispatcherOperationWait(Task, TimeSpan)

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

DispatcherOperationWait(Task)

Waits indefinitely for the underlying DispatcherOperation to complete.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Windows::Threading::DispatcherOperationStatus DispatcherOperationWait(System::Threading::Tasks::Task ^ this);
public static System.Windows.Threading.DispatcherOperationStatus DispatcherOperationWait (this System.Threading.Tasks.Task this);
static member DispatcherOperationWait :  -> System.Windows.Threading.DispatcherOperationStatus
<Extension()>
Public Function DispatcherOperationWait (this As Task) As DispatcherOperationStatus

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.

Applies to

DispatcherOperationWait(Task, TimeSpan)

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

public:
[System::Runtime::CompilerServices::Extension]
 static System::Windows::Threading::DispatcherOperationStatus DispatcherOperationWait(System::Threading::Tasks::Task ^ this, TimeSpan timeout);
public static System.Windows.Threading.DispatcherOperationStatus DispatcherOperationWait (this System.Threading.Tasks.Task this, TimeSpan timeout);
static member DispatcherOperationWait : TimeSpan -> System.Windows.Threading.DispatcherOperationStatus
<Extension()>
Public Function DispatcherOperationWait (this As Task, timeout As TimeSpan) As DispatcherOperationStatus

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.

Applies to