DispatcherExtensions.BeginInvoke Method

Definition

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

Overloads

BeginInvoke(Dispatcher, Action)

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

BeginInvoke(Dispatcher, Action, DispatcherPriority)

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

BeginInvoke(Dispatcher, Action)

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

C#
public static System.Windows.Threading.DispatcherOperation BeginInvoke(this System.Windows.Threading.Dispatcher dispatcher, Action action);
C#
[System.ComponentModel.Browsable(false)]
public static System.Windows.Threading.DispatcherOperation BeginInvoke(this System.Windows.Threading.Dispatcher dispatcher, Action action);

Parameters

dispatcher
Dispatcher

The dispatcher that executes the delegate.

action
Action

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

Returns

An IAsyncResult object that represents the result of the BeginInvoke(Dispatcher, Action) operation.

Attributes

Exceptions

action is null.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

BeginInvoke(Dispatcher, Action, DispatcherPriority)

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

C#
public static System.Windows.Threading.DispatcherOperation BeginInvoke(this System.Windows.Threading.Dispatcher dispatcher, Action action, System.Windows.Threading.DispatcherPriority priority);
C#
[System.ComponentModel.Browsable(false)]
public static System.Windows.Threading.DispatcherOperation BeginInvoke(this System.Windows.Threading.Dispatcher dispatcher, Action action, System.Windows.Threading.DispatcherPriority priority);

Parameters

dispatcher
Dispatcher

The dispatcher that executes the delegate.

action
Action

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

priority
DispatcherPriority

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

Returns

An IAsyncResult object that represents the result of the BeginInvoke(Dispatcher, Action, DispatcherPriority) operation.

Attributes

Exceptions

action is null.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10