# IMultiThreadedDispatcherService.InvokeAsync method

Runs the action on the UI thread and returns a task that completes when the action has run.

**Namespace:** [`Eremex.AvaloniaUI.Controls.ApplicationServices`](https://eremexcontrols.net/API/Eremex.AvaloniaUI.Controls.ApplicationServices/index.md)  
**Assembly:** `Eremex.Common.Contracts.dll`  
**NuGet Package:** [Eremex.Common.Contracts](https://www.nuget.org/packages/Eremex.Common.Contracts)

## Declaration

```csharp
public Task InvokeAsync(Action action)
```

## Parameters

| name | type | description |
| --- | --- | --- |
| action | `Action` | The action to run on the UI thread. |

## Returns

| type | description |
| --- | --- |
| `Task` | A task that completes once the action has finished running. |

## See Also

* interface [IMultiThreadedDispatcherService](https://eremexcontrols.net/API/Eremex.AvaloniaUI.Controls.ApplicationServices/IMultiThreadedDispatcherService/index.md)
* namespace [Eremex.AvaloniaUI.Controls.ApplicationServices](https://eremexcontrols.net/API/Eremex.AvaloniaUI.Controls.ApplicationServices/index.md)

<!-- DO NOT EDIT: generated by xmldocmd for Eremex.Common.Contracts.dll -->
