DispatcherExtensions.Invoke DispatcherExtensions.Invoke DispatcherExtensions.Invoke Method

Definition

Executes the specified delegate synchronously on the thread that the specified Dispatcher was created on.

Overloads

Invoke(Dispatcher, Action) Invoke(Dispatcher, Action) Invoke(Dispatcher, Action)

Executes the specified delegate synchronously with normal priority on the thread that the specified Dispatcher was created on.

Invoke(Dispatcher, Action, TimeSpan) Invoke(Dispatcher, Action, TimeSpan) Invoke(Dispatcher, Action, TimeSpan)

Executes the specified delegate synchronously on the thread that the specified Dispatcher was created on, and stops execution after the specified time-out period.

Invoke(Dispatcher, Action, DispatcherPriority) Invoke(Dispatcher, Action, DispatcherPriority) Invoke(Dispatcher, Action, DispatcherPriority)

Executes the specified delegate synchronously with the specified priority on the thread that the specified Dispatcher was created on.

Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority) Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority) Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority)

Executes the specified delegate synchronously with the specified priority on the thread that the specified Dispatcher was created on, and stops execution after the specified time-out period.

Invoke(Dispatcher, Action) Invoke(Dispatcher, Action) Invoke(Dispatcher, Action)

Executes the specified delegate synchronously with normal priority on the thread that the specified Dispatcher was created on.

public:
[System::Runtime::CompilerServices::Extension]
 static void Invoke(System::Windows::Threading::Dispatcher ^ dispatcher, Action ^ action);
[System.ComponentModel.Browsable(false)]
public static void Invoke (this System.Windows.Threading.Dispatcher dispatcher, Action action);
static member Invoke : System.Windows.Threading.Dispatcher * Action -> unit

Parameters

dispatcher
Dispatcher Dispatcher Dispatcher

The dispatcher that executes the delegate.

action
Action Action Action

The delegate to execute, which takes no arguments and does not return a value.

Exceptions

Invoke(Dispatcher, Action, TimeSpan) Invoke(Dispatcher, Action, TimeSpan) Invoke(Dispatcher, Action, TimeSpan)

Executes the specified delegate synchronously on the thread that the specified Dispatcher was created on, and stops execution after the specified time-out period.

public:
[System::Runtime::CompilerServices::Extension]
 static void Invoke(System::Windows::Threading::Dispatcher ^ dispatcher, Action ^ action, TimeSpan timeout);
[System.ComponentModel.Browsable(false)]
public static void Invoke (this System.Windows.Threading.Dispatcher dispatcher, Action action, TimeSpan timeout);
static member Invoke : System.Windows.Threading.Dispatcher * Action * TimeSpan -> unit

Parameters

dispatcher
Dispatcher Dispatcher Dispatcher

The dispatcher that executes the delegate.

action
Action Action Action

The delegate to execute, which takes no arguments and does not return a value.

timeout
TimeSpan TimeSpan TimeSpan

The maximum time to wait for the operation to finish.

Exceptions

Invoke(Dispatcher, Action, DispatcherPriority) Invoke(Dispatcher, Action, DispatcherPriority) Invoke(Dispatcher, Action, DispatcherPriority)

Executes the specified delegate synchronously with the specified priority on the thread that the specified Dispatcher was created on.

public:
[System::Runtime::CompilerServices::Extension]
 static void Invoke(System::Windows::Threading::Dispatcher ^ dispatcher, Action ^ action, System::Windows::Threading::DispatcherPriority priority);
[System.ComponentModel.Browsable(false)]
public static void Invoke (this System.Windows.Threading.Dispatcher dispatcher, Action action, System.Windows.Threading.DispatcherPriority priority);
static member Invoke : System.Windows.Threading.Dispatcher * Action * System.Windows.Threading.DispatcherPriority -> unit

Parameters

dispatcher
Dispatcher Dispatcher Dispatcher

The dispatcher that executes the delegate.

action
Action Action Action

The delegate to execute, which takes no arguments and does not return a value.

priority
DispatcherPriority DispatcherPriority DispatcherPriority

The execution priority of the delegate relative to other pending operations in the Dispatcher event queue.

Exceptions

Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority) Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority) Invoke(Dispatcher, Action, TimeSpan, DispatcherPriority)

Executes the specified delegate synchronously with the specified priority on the thread that the specified Dispatcher was created on, and stops execution after the specified time-out period.

public:
[System::Runtime::CompilerServices::Extension]
 static void Invoke(System::Windows::Threading::Dispatcher ^ dispatcher, Action ^ action, TimeSpan timeout, System::Windows::Threading::DispatcherPriority priority);
[System.ComponentModel.Browsable(false)]
public static void Invoke (this System.Windows.Threading.Dispatcher dispatcher, Action action, TimeSpan timeout, System.Windows.Threading.DispatcherPriority priority);
static member Invoke : System.Windows.Threading.Dispatcher * Action * TimeSpan * System.Windows.Threading.DispatcherPriority -> unit

Parameters

dispatcher
Dispatcher Dispatcher Dispatcher

The dispatcher that executes the delegate.

action
Action Action Action

The delegate to execute, which takes no arguments and does not return a value.

timeout
TimeSpan TimeSpan TimeSpan

The maximum time to wait for the operation to finish.

priority
DispatcherPriority DispatcherPriority DispatcherPriority

The execution priority of the delegate relative to other pending operations in the Dispatcher event queue.

Exceptions

Applies to