Edit

Share via


DispatcherTimer Constructors

Definition

Initializes a new instance of the DispatcherTimer class.

Overloads

DispatcherTimer()

Initializes a new instance of the DispatcherTimer class.

DispatcherTimer(DispatcherPriority)

Initializes a new instance of the DispatcherTimer class which processes timer events at the specified priority.

DispatcherTimer(DispatcherPriority, Dispatcher)

Initializes a new instance of the DispatcherTimer class which runs on the specified Dispatcher at the specified priority.

DispatcherTimer(TimeSpan, DispatcherPriority, EventHandler, Dispatcher)

Initializes a new instance of the DispatcherTimer class which uses the specified time interval, priority, event handler, and Dispatcher.

DispatcherTimer()

Initializes a new instance of the DispatcherTimer class.

public:
 DispatcherTimer();
public DispatcherTimer ();
Public Sub New ()

Remarks

DispatcherTimer runs on the Dispatcher of the current thread at Background priority. To specify a different Dispatcher, use the following constructor: DispatcherTimer.DispatcherTimer(DispatcherPriority, Dispatcher).

Applies to

DispatcherTimer(DispatcherPriority)

Initializes a new instance of the DispatcherTimer class which processes timer events at the specified priority.

public:
 DispatcherTimer(System::Windows::Threading::DispatcherPriority priority);
public DispatcherTimer (System.Windows.Threading.DispatcherPriority priority);
new System.Windows.Threading.DispatcherTimer : System.Windows.Threading.DispatcherPriority -> System.Windows.Threading.DispatcherTimer
Public Sub New (priority As DispatcherPriority)

Parameters

priority
DispatcherPriority

The priority at which to invoke the timer.

Remarks

DispatcherTimer runs on the Dispatcher of the current thread. To specify a different Dispatcher, use the following constructor: DispatcherTimer(DispatcherPriority, Dispatcher).

Applies to

DispatcherTimer(DispatcherPriority, Dispatcher)

Initializes a new instance of the DispatcherTimer class which runs on the specified Dispatcher at the specified priority.

public:
 DispatcherTimer(System::Windows::Threading::DispatcherPriority priority, System::Windows::Threading::Dispatcher ^ dispatcher);
public DispatcherTimer (System.Windows.Threading.DispatcherPriority priority, System.Windows.Threading.Dispatcher dispatcher);
new System.Windows.Threading.DispatcherTimer : System.Windows.Threading.DispatcherPriority * System.Windows.Threading.Dispatcher -> System.Windows.Threading.DispatcherTimer
Public Sub New (priority As DispatcherPriority, dispatcher As Dispatcher)

Parameters

priority
DispatcherPriority

The priority at which to invoke the timer.

dispatcher
Dispatcher

The dispatcher the timer is associated with.

Exceptions

dispatcher is null.

Applies to

DispatcherTimer(TimeSpan, DispatcherPriority, EventHandler, Dispatcher)

Initializes a new instance of the DispatcherTimer class which uses the specified time interval, priority, event handler, and Dispatcher.

public:
 DispatcherTimer(TimeSpan interval, System::Windows::Threading::DispatcherPriority priority, EventHandler ^ callback, System::Windows::Threading::Dispatcher ^ dispatcher);
public DispatcherTimer (TimeSpan interval, System.Windows.Threading.DispatcherPriority priority, EventHandler callback, System.Windows.Threading.Dispatcher dispatcher);
new System.Windows.Threading.DispatcherTimer : TimeSpan * System.Windows.Threading.DispatcherPriority * EventHandler * System.Windows.Threading.Dispatcher -> System.Windows.Threading.DispatcherTimer
Public Sub New (interval As TimeSpan, priority As DispatcherPriority, callback As EventHandler, dispatcher As Dispatcher)

Parameters

interval
TimeSpan

The period of time between ticks.

priority
DispatcherPriority

The priority at which to invoke the timer.

callback
EventHandler

The event handler to call when the Tick event occurs.

dispatcher
Dispatcher

The dispatcher the timer is associated with.

Exceptions

callback is null.

-or-

dispatcher is null.

interval is less than 0 or greater than Int32.MaxValue.

Applies to