IDispatcher.

InvokeAsync<TResult>(Func<Task<TResult>>, DispatcherPriority) Method

Summary

Queues the specified work to run on the dispatcher thread and returns a proxy for the task returned by function.
Namespace
Avalonia.Threading
Containing Type
IDispatcher

Syntax

Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> function, DispatcherPriority priority = Normal)

Type Parameters

Name Description
TResult

Parameters

Name Type Description
function Func<Task<TResult>> The work to execute asynchronously.
priority DispatcherPriority The priority with which to invoke the method.

Return Value

Type Description
Task<TResult> A task that represents a proxy for the task returned by function.