Run Method
Starts a new timer.
Definition
Namespace: Avalonia.Threading
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public static IDisposable Run(
Func<bool> action,
TimeSpan interval,
DispatcherPriority priority = default
)
Public Shared Function Run (
action As Func(Of Boolean),
interval As TimeSpan,
Optional priority As DispatcherPriority = Nothing
) As IDisposable
static member Run :
action : Func<bool> *
interval : TimeSpan *
?priority : DispatcherPriority
(* Defaults:
let _priority = defaultArg priority new DispatcherPriority()
*)
-> IDisposable
Parameters
- Func(Boolean)
- The method to call on timer tick. If the method returns false, the timer will stop.
- TimeSpan
- The interval at which to tick.
- DispatcherPriority (Optional)
- The priority to use.
Return Value
IDisposable
An IDisposable used to cancel the timer.