DispatcherTimerRun Method

Starts a new timer.

Definition

Namespace: Avalonia.Threading
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public static IDisposable Run(
	Func<bool> action,
	TimeSpan interval,
	DispatcherPriority priority = default
)

Parameters

action  FuncBoolean
The method to call on timer tick. If the method returns false, the timer will stop.
interval  TimeSpan
The interval at which to tick.
priority  DispatcherPriority  (Optional)
The priority to use.

Return Value

IDisposable
An IDisposable used to cancel the timer.

See Also