Edit

Share via


EventHandlerExtensions.InvokeAsync Method

Definition

Overloads

InvokeAsync<T>(EventHandler<T>, Object, T)

Use to invoke an async EventHandler<TEventArgs> using DeferredEventArgs.

InvokeAsync<T>(EventHandler<T>, Object, T, CancellationToken)

Use to invoke an async EventHandler<TEventArgs> using DeferredEventArgs with a CancellationToken.

InvokeAsync<T>(EventHandler<T>, Object, T)

Use to invoke an async EventHandler<TEventArgs> using DeferredEventArgs.

public static System.Threading.Tasks.Task InvokeAsync<T> (this EventHandler<T> eventHandler, object sender, T eventArgs) where T : Microsoft.Toolkit.Deferred.DeferredEventArgs;
static member InvokeAsync : EventHandler<'T (requires 'T :> Microsoft.Toolkit.Deferred.DeferredEventArgs)> * obj * 'T -> System.Threading.Tasks.Task (requires 'T :> Microsoft.Toolkit.Deferred.DeferredEventArgs)
<Extension()>
Public Function InvokeAsync(Of T As DeferredEventArgs) (eventHandler As EventHandler(Of T), sender As Object, eventArgs As T) As Task

Type Parameters

T

EventArgs type.

Parameters

eventHandler
EventHandler<T>

EventHandler<TEventArgs> to be invoked.

sender
Object

Sender of the event.

eventArgs
T

EventArgs instance.

Returns

Task to wait on deferred event handler.

Applies to

InvokeAsync<T>(EventHandler<T>, Object, T, CancellationToken)

Use to invoke an async EventHandler<TEventArgs> using DeferredEventArgs with a CancellationToken.

public static System.Threading.Tasks.Task InvokeAsync<T> (this EventHandler<T> eventHandler, object sender, T eventArgs, System.Threading.CancellationToken cancellationToken) where T : Microsoft.Toolkit.Deferred.DeferredEventArgs;
static member InvokeAsync : EventHandler<'T (requires 'T :> Microsoft.Toolkit.Deferred.DeferredEventArgs)> * obj * 'T * System.Threading.CancellationToken -> System.Threading.Tasks.Task (requires 'T :> Microsoft.Toolkit.Deferred.DeferredEventArgs)
<Extension()>
Public Function InvokeAsync(Of T As DeferredEventArgs) (eventHandler As EventHandler(Of T), sender As Object, eventArgs As T, cancellationToken As CancellationToken) As Task

Type Parameters

T

EventArgs type.

Parameters

eventHandler
EventHandler<T>

EventHandler<TEventArgs> to be invoked.

sender
Object

Sender of the event.

eventArgs
T

EventArgs instance.

cancellationToken
CancellationToken

CancellationToken option.

Returns

Task to wait on deferred event handler.

Applies to