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 SourceDispatcherTimer()
Initializes a new instance of the DispatcherTimer class.
Declaration
public DispatcherTimer()
Properties
| Improve this Doc View SourceInterval
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. |
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 SourceOnTick()
Raises the Tick event.
Declaration
protected void OnTick()
Start()
Starts the DispatcherTimer.
Declaration
public void Start()
Stop()
Stops the DispatcherTimer.
Declaration
public void Stop()
Events
| Improve this Doc View SourceTick
Occurs when the timer interval has elapsed.
Declaration
public event EventHandler Tick
Event Type
Type | Description |
---|---|
System.EventHandler |