Редагувати

Поділитися через


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.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Windows::Threading::DispatcherOperation ^ BeginInvoke(System::Windows::Threading::Dispatcher ^ dispatcher, Action ^ action);
public static System.Windows.Threading.DispatcherOperation BeginInvoke (this System.Windows.Threading.Dispatcher dispatcher, Action action);
[System.ComponentModel.Browsable(false)]
public static System.Windows.Threading.DispatcherOperation BeginInvoke (this System.Windows.Threading.Dispatcher dispatcher, Action action);
static member BeginInvoke : System.Windows.Threading.Dispatcher * Action -> System.Windows.Threading.DispatcherOperation
[<System.ComponentModel.Browsable(false)>]
static member BeginInvoke : System.Windows.Threading.Dispatcher * Action -> System.Windows.Threading.DispatcherOperation
<Extension()>
Public Function BeginInvoke (dispatcher As Dispatcher, action As Action) As DispatcherOperation

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

BeginInvoke(Dispatcher, Action, DispatcherPriority)

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

public:
[System::Runtime::CompilerServices::Extension]
 static System::Windows::Threading::DispatcherOperation ^ BeginInvoke(System::Windows::Threading::Dispatcher ^ dispatcher, Action ^ action, System::Windows::Threading::DispatcherPriority priority);
public static System.Windows.Threading.DispatcherOperation BeginInvoke (this System.Windows.Threading.Dispatcher dispatcher, Action action, System.Windows.Threading.DispatcherPriority priority);
[System.ComponentModel.Browsable(false)]
public static System.Windows.Threading.DispatcherOperation BeginInvoke (this System.Windows.Threading.Dispatcher dispatcher, Action action, System.Windows.Threading.DispatcherPriority priority);
static member BeginInvoke : System.Windows.Threading.Dispatcher * Action * System.Windows.Threading.DispatcherPriority -> System.Windows.Threading.DispatcherOperation
[<System.ComponentModel.Browsable(false)>]
static member BeginInvoke : System.Windows.Threading.Dispatcher * Action * System.Windows.Threading.DispatcherPriority -> System.Windows.Threading.DispatcherOperation
<Extension()>
Public Function BeginInvoke (dispatcher As Dispatcher, action As Action, priority As DispatcherPriority) As DispatcherOperation

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