Table of Contents

Method InvokeAsync

Namespace
Terminal.Gui.App
Assembly
Terminal.Gui.dll

InvokeAsync(Action<IApplication>, SessionToken?, CancellationToken)

Runs an action on the application's UI thread and completes when the action returns.

Task InvokeAsync(Action<IApplication> action, SessionToken? owner, CancellationToken cancellationToken = default)

Parameters

action Action<IApplication>

The action to run with the application instance.

owner SessionToken

The session that owns the action, or null for application-owned work.

cancellationToken CancellationToken

Cancels a dispatch that has not started.

Returns

Task

A task that reports completion, cancellation, or the action's exception.