Show / Hide Table of Contents

Class DispatcherTimer

A timer that is integrated into the Dispatcher queue, which is processed at a specified interval of time and at a specified priority.

Inheritance
System.Object
DispatcherTimer
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Threading
Assembly: OpenSilver.dll
Syntax
public class DispatcherTimer

Constructors

| Improve this Doc View Source

DispatcherTimer()

Initializes a new instance of the DispatcherTimer class.

Declaration
public DispatcherTimer()

Properties

| Improve this Doc View Source

Interval

Gets or sets the amount of time between timer ticks.

Declaration
public TimeSpan Interval { get; set; }
Property Value
Type Description
System.TimeSpan

The amount of time between ticks. The default is System.TimeSpan.Zero.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The specified value when setting this property represents a negative time interval.

| Improve this Doc View Source

IsEnabled

Gets a value that indicates whether the timer is running.

Declaration
public bool IsEnabled { get; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

OnTick()

Raises the Tick event.

Declaration
protected void OnTick()
| Improve this Doc View Source

Start()

Starts the DispatcherTimer.

Declaration
public void Start()
| Improve this Doc View Source

Stop()

Stops the DispatcherTimer.

Declaration
public void Stop()

Events

| Improve this Doc View Source

Tick

Occurs when the timer interval has elapsed.

Declaration
public event EventHandler Tick
Event Type
Type Description
System.EventHandler
  • Improve this Doc
  • View Source