DispatcherTimerRunOnce Method

Runs a method once, after the specified interval.

Definition

Namespace: Avalonia.Threading
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public static IDisposable RunOnce(
	Action action,
	TimeSpan interval,
	DispatcherPriority priority = default
)

Parameters

action  Action
The method to call after the interval has elapsed.
interval  TimeSpan
The interval after which to call the method.
priority  DispatcherPriority  (Optional)
The priority to use.

Return Value

IDisposable
An IDisposable used to cancel the timer.

See Also