Summary
Provides services for managing work items on a thread.
- Namespace
- Avalonia
.Threading - Interfaces
- Base Types
-
- object
graph BT
Type-->Base0["object"]
Type-.->Interface0["IDispatcher"]
click Interface0 "/api/Avalonia.Threading/IDispatcher"
Type["Dispatcher"]
class Type type-node
Syntax
public class Dispatcher : IDispatcher
Remarks
In Avalonia, there is usually only a single
Dispatcher
in the application -
the one for the UI thread, retrieved via the UIThread
property.
Constructors
Name | Summary |
---|---|
Dispatcher |
Properties
Name | Value | Summary |
---|---|---|
UIThread | Dispatcher |
static
|
Methods
Name | Value | Summary |
---|---|---|
CheckAccess |
bool |
Checks that the current thread is the UI thread.
|
InvokeAsync |
Task |
Posts an action that will be invoked on the dispatcher thread.
|
InvokeAsync |
Task |
Queues the specified work to run on the dispatcher thread and returns a proxy for the
task returned by function.
|
InvokeAsync |
Task |
Queues the specified work to run on the dispatcher thread and returns a proxy for the
task returned by function.
|
InvokeAsync |
Task |
Posts a function that will be invoked on the dispatcher thread.
|
MainLoop |
void |
Runs the dispatcher's main loop.
|
Post |
void |
Invokes a method on the dispatcher thread.
|
RunJobs |
void |
Runs continuations pushed on the loop.
|
RunJobs |
void |
Use this method to ensure that more prioritized tasks are executed
|
VerifyAccess |
void |
Checks that the current thread is the UI thread and throws if not.
|