Skip to main content

DispatcherTimer Class

A timer that is integrated into the Dispatcher queues, and will be processed after a given amount of time at a specified priority.

Definition

Namespace: Avalonia.Threading
Assembly: Avalonia.Base (in Avalonia.Base.dll)

public class DispatcherTimer
View Source
InheritanceObject → DispatcherTimer

Constructors

DispatcherTimer()Creates a timer that uses theUI thread's Dispatcher2 to process the timer event at background priority.
DispatcherTimer(DispatcherPriority)Creates a timer that uses the UI thread's Dispatcher2 to process the timer event at the specified priority.
DispatcherTimer(TimeSpan, DispatcherPriority, EventHandler)Creates a timer that uses the UI thread's Dispatcher2 to process the timer event at the specified priority after the specified timeout.

Properties

DispatcherGets the dispatcher this timer is associated with.
IntervalGets or sets the time between timer ticks.
IsEnabledGets or sets whether the timer is running.
TagAny data that the caller wants to pass along with the timer.

Methods

Equals(Object)Determines whether the specified object is equal to the current object.
(Inherited from Object)
Finalize()Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCode()Serves as the default hash function.
(Inherited from Object)
GetType()Gets the Type of the current instance.
(Inherited from Object)
MemberwiseClone()Creates a shallow copy of the current Object.
(Inherited from Object)
Run(Func(Boolean), TimeSpan, DispatcherPriority)Starts a new timer.
RunOnce(Action, TimeSpan, DispatcherPriority)Runs a method once, after the specified interval.
Start()Starts the timer.
Stop()Stops the timer.
ToString()Returns a string that represents the current object.
(Inherited from Object)

Events

TickOccurs when the specified timer interval has elapsed and the timer is enabled.

See Also

Reference

Avalonia.Threading Namespace