A timer that is integrated into the Dispatcher queue which is processed at a specified interval of time and at a specified priority.
Assembly: WindowsBase (in WindowsBase.dll)
Initializes a new instance of theclass.
Initializes a new instance of theclass which processes timer events at the specified priority.
Initializes a new instance of the Dispatcher at the specified priority.class which runs on the specified
|DispatcherTimer(TimeSpan, DispatcherPriority, EventHandler, Dispatcher)|
Initializes a new instance of the Dispatcher.class which uses the specified time interval, priority, event handler, and
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Serves as the default hash function. (Inherited from Object.)
Returns a string that represents the current object.(Inherited from Object.)
The Dispatcher loop.is reevaluated at the top of every
Timers are not guaranteed to execute exactly when the time interval occurs, but they are guaranteed to not execute before the time interval occurs. This is because Dispatcher queue like other operations. When the operation executes is dependent on the other jobs in the queue and their priorities.operations are placed on the
If a System.Timers.Timer is used in a WPF application, it is worth noting that the System.Timers.Timer runs on a different thread then the user interface (UI) thread. In order to access objects on the user interface (UI) thread, it is necessary to post the operation onto the Dispatcher of the user interface (UI) thread using Invoke or BeginInvoke. Reasons for using a opposed to a System.Timers.Timer are that the runs on the same thread as the Dispatcher and a DispatcherPriority can be set on the .
Awill keep an object alive whenever the object's methods are bound to the timer.
Legacy Code Example
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.