DispatcherTimer Class

Summary

A timer that uses a Dispatcher to fire at a specified interval.
Namespace
Avalonia.Threading
Base Types
  • object
graph BT Type-->Base0["object"] Type["DispatcherTimer"] class Type type-node

Syntax

public class DispatcherTimer

Constructors

Name Summary
DispatcherTimer() Initializes a new instance of the DispatcherTimer class.
DispatcherTimer(DispatcherPriority) Initializes a new instance of the DispatcherTimer class.
DispatcherTimer(TimeSpan, DispatcherPriority, EventHandler) Initializes a new instance of the DispatcherTimer class.

Events

Name Type Summary
Tick EventHandler
Raised when the timer ticks.

Properties

Name Value Summary
Interval TimeSpan
Gets or sets the interval at which the timer ticks.
IsEnabled bool
Gets or sets a value indicating whether the timer is running.
Tag object
Gets or sets user-defined data associated with the timer.

Methods

Name Value Summary
~DispatcherTimer() void
Finalizes an instance of the DispatcherTimer class.
Run(Func<bool>, TimeSpan, DispatcherPriority) IDisposable
Starts a new timer.
static
RunOnce(Action, TimeSpan, DispatcherPriority) IDisposable
Runs a method once, after the specified interval.
static
Start() void
Starts the timer.
Stop() void
Stops the timer.