Method SendAsync
SendAsync(Action)
Synchronously executes the specified action if the current thread is the UI thread, otherwise asynchronously posts it to the UI thread for
execution and returns a task that completes when execution finishes. Tracked as a non-busy task.
Declaration
public ValueTask SendAsync(Action action)
Parameters
| Type |
Name |
Description |
| Action |
action |
|
Returns
Implements
SendAsync<T>(T, Action<T>)
Synchronously executes the specified action if the current thread is the UI thread, otherwise asynchronously posts it to the UI thread
for execution and returns a task that completes when execution finishes. Tracked as a non-busy task.
Declaration
public ValueTask SendAsync<T>(T state, Action<T> action)
Parameters
| Type |
Name |
Description |
| T |
state |
|
| Action<T> |
action |
|
Returns
Type Parameters
Implements
SendAsync<TResult>(Func<TResult>)
Synchronously executes the specified function if the current thread is the UI thread, otherwise asynchronously posts it to the UI
thread for execution and returns a task that contains the result when execution finishes. Tracked as a non-busy task.
Declaration
public ValueTask<TResult> SendAsync<TResult>(Func<TResult> func)
Parameters
| Type |
Name |
Description |
| Func<TResult> |
func |
|
Returns
Type Parameters
Implements
SendAsync<T, TResult>(T, Func<T, TResult>)
Synchronously executes the specified function using the provided state if the current thread is the UI thread, otherwise asynchronously posts them to
the UI thread for execution and returns a task that contains the result of the function when execution finishes. Tracked as a non-busy task.
Declaration
public ValueTask<TResult> SendAsync<T, TResult>(T state, Func<T, TResult> func)
Parameters
| Type |
Name |
Description |
| T |
state |
|
| Func<T, TResult> |
func |
|
Returns
Type Parameters
| Name |
Description |
| T |
|
| TResult |
|
Implements
SendAsync(Func<Task>)
Synchronously executes the specified function if the current thread is the UI thread, otherwise asynchronously posts it to the UI thread for execution,
and then returns a task that completes when the execution of the task returned by the function completes. Tracked as a non-busy task.
Declaration
public Task SendAsync(Func<Task> taskFunc)
Parameters
| Type |
Name |
Description |
| Func<Task> |
taskFunc |
|
Returns
Implements
SendAsync<TResult>(Func<Task<TResult>>)
Synchronously executes the specified function if the current thread is the UI thread, otherwise asynchronously posts it to the UI thread for execution,
and then returns a task that contains the result of the task returned by the function when it completes. Tracked as a non-busy task.
Declaration
public Task<TResult> SendAsync<TResult>(Func<Task<TResult>> taskFunc)
Parameters
| Type |
Name |
Description |
| Func<Task<TResult>> |
taskFunc |
|
Returns
| Type |
Description |
| Task<TResult> |
|
Type Parameters
Implements