Dispatcher.InvokeAsync Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Exécute le délégué spécifié de façon asynchrone au niveau du thread auquel le Dispatcher est associé.
Surcharges
InvokeAsync(Action) |
Exécute l'objet Action spécifié de façon asynchrone au niveau du thread auquel le Dispatcher est associé. |
InvokeAsync(Action, DispatcherPriority) |
Exécute l'objet Action spécifié de façon asynchrone selon la priorité spécifiée au niveau du thread auquel le Dispatcher est associé. |
InvokeAsync(Action, DispatcherPriority, CancellationToken) |
Exécute l'objet Action spécifié de façon asynchrone selon la priorité spécifiée au niveau du thread auquel le Dispatcher est associé. |
InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken) |
Exécute l'objet Func<TResult> spécifié de façon asynchrone selon la priorité spécifiée au niveau du thread auquel le Dispatcher est associé. |
InvokeAsync<TResult>(Func<TResult>) |
Exécute l'objet Func<TResult> spécifié de façon asynchrone au niveau du thread auquel le Dispatcher est associé. |
InvokeAsync<TResult>(Func<TResult>, DispatcherPriority) |
Exécute l'objet Func<TResult> spécifié de façon asynchrone selon la priorité spécifiée au niveau du thread auquel le Dispatcher est associé. |
InvokeAsync(Action)
Exécute l'objet Action spécifié de façon asynchrone au niveau du thread auquel le Dispatcher est associé.
public:
System::Windows::Threading::DispatcherOperation ^ InvokeAsync(Action ^ callback);
public System.Windows.Threading.DispatcherOperation InvokeAsync (Action callback);
member this.InvokeAsync : Action -> System.Windows.Threading.DispatcherOperation
Public Function InvokeAsync (callback As Action) As DispatcherOperation
Paramètres
- callback
- Action
Délégué permettant d'appeler via le répartiteur.
Retours
Objet qui est retourné immédiatement après l'appel de InvokeAsync(Action) et qui peut être utilisé pour interagir avec le délégué en attente d'exécution dans la file d'attente des événements.
Remarques
La priorité par défaut est DispatcherPriority.Normal
.
S’applique à
InvokeAsync(Action, DispatcherPriority)
Exécute l'objet Action spécifié de façon asynchrone selon la priorité spécifiée au niveau du thread auquel le Dispatcher est associé.
public:
System::Windows::Threading::DispatcherOperation ^ InvokeAsync(Action ^ callback, System::Windows::Threading::DispatcherPriority priority);
public System.Windows.Threading.DispatcherOperation InvokeAsync (Action callback, System.Windows.Threading.DispatcherPriority priority);
member this.InvokeAsync : Action * System.Windows.Threading.DispatcherPriority -> System.Windows.Threading.DispatcherOperation
Public Function InvokeAsync (callback As Action, priority As DispatcherPriority) As DispatcherOperation
Paramètres
- callback
- Action
Délégué permettant d'appeler via le répartiteur.
- priority
- DispatcherPriority
Priorité qui détermine l’ordre dans lequel le rappel spécifié est appelé par rapport aux autres opérations en attente dans le Dispatcher.
Retours
Objet qui est retourné immédiatement après l'appel de InvokeAsync(Action, DispatcherPriority) et qui peut être utilisé pour interagir avec le délégué en attente d'exécution dans la file d'attente des événements.
S’applique à
InvokeAsync(Action, DispatcherPriority, CancellationToken)
Exécute l'objet Action spécifié de façon asynchrone selon la priorité spécifiée au niveau du thread auquel le Dispatcher est associé.
public:
System::Windows::Threading::DispatcherOperation ^ InvokeAsync(Action ^ callback, System::Windows::Threading::DispatcherPriority priority, System::Threading::CancellationToken cancellationToken);
public System.Windows.Threading.DispatcherOperation InvokeAsync (Action callback, System.Windows.Threading.DispatcherPriority priority, System.Threading.CancellationToken cancellationToken);
member this.InvokeAsync : Action * System.Windows.Threading.DispatcherPriority * System.Threading.CancellationToken -> System.Windows.Threading.DispatcherOperation
Public Function InvokeAsync (callback As Action, priority As DispatcherPriority, cancellationToken As CancellationToken) As DispatcherOperation
Paramètres
- callback
- Action
Délégué permettant d'appeler via le répartiteur.
- priority
- DispatcherPriority
Priorité qui détermine l’ordre dans lequel le rappel spécifié est appelé par rapport aux autres opérations en attente dans le Dispatcher.
- cancellationToken
- CancellationToken
Objet qui indique s'il est nécessaire d'annuler l'action.
Retours
Objet qui est retourné immédiatement après l'appel de InvokeAsync(Action, DispatcherPriority, CancellationToken) et qui peut être utilisé pour interagir avec le délégué en attente d'exécution dans la file d'attente des événements.
S’applique à
InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken)
Exécute l'objet Func<TResult> spécifié de façon asynchrone selon la priorité spécifiée au niveau du thread auquel le Dispatcher est associé.
public:
generic <typename TResult>
System::Windows::Threading::DispatcherOperation<TResult> ^ InvokeAsync(Func<TResult> ^ callback, System::Windows::Threading::DispatcherPriority priority, System::Threading::CancellationToken cancellationToken);
public System.Windows.Threading.DispatcherOperation<TResult> InvokeAsync<TResult> (Func<TResult> callback, System.Windows.Threading.DispatcherPriority priority, System.Threading.CancellationToken cancellationToken);
member this.InvokeAsync : Func<'Result> * System.Windows.Threading.DispatcherPriority * System.Threading.CancellationToken -> System.Windows.Threading.DispatcherOperation<'Result>
Public Function InvokeAsync(Of TResult) (callback As Func(Of TResult), priority As DispatcherPriority, cancellationToken As CancellationToken) As DispatcherOperation(Of TResult)
Paramètres de type
- TResult
Type de valeur de retour du délégué spécifié.
Paramètres
- callback
- Func<TResult>
Délégué permettant d'appeler via le répartiteur.
- priority
- DispatcherPriority
Priorité qui détermine l’ordre dans lequel le rappel spécifié est appelé par rapport aux autres opérations en attente dans le Dispatcher.
- cancellationToken
- CancellationToken
Objet qui indique s'il est nécessaire d'annuler l'opération.
Retours
Objet qui est retourné immédiatement après l'appel de InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken) et qui peut être utilisé pour interagir avec le délégué en attente d'exécution dans la file d'attente des événements.
S’applique à
InvokeAsync<TResult>(Func<TResult>)
Exécute l'objet Func<TResult> spécifié de façon asynchrone au niveau du thread auquel le Dispatcher est associé.
public:
generic <typename TResult>
System::Windows::Threading::DispatcherOperation<TResult> ^ InvokeAsync(Func<TResult> ^ callback);
public System.Windows.Threading.DispatcherOperation<TResult> InvokeAsync<TResult> (Func<TResult> callback);
member this.InvokeAsync : Func<'Result> -> System.Windows.Threading.DispatcherOperation<'Result>
Public Function InvokeAsync(Of TResult) (callback As Func(Of TResult)) As DispatcherOperation(Of TResult)
Paramètres de type
- TResult
Type de valeur de retour du délégué spécifié.
Paramètres
- callback
- Func<TResult>
Délégué permettant d'appeler via le répartiteur.
Retours
Objet qui est retourné immédiatement après l'appel de InvokeAsync<TResult>(Func<TResult>) et qui peut être utilisé pour interagir avec le délégué en attente d'exécution dans la file d'attente des événements.
S’applique à
InvokeAsync<TResult>(Func<TResult>, DispatcherPriority)
Exécute l'objet Func<TResult> spécifié de façon asynchrone selon la priorité spécifiée au niveau du thread auquel le Dispatcher est associé.
public:
generic <typename TResult>
System::Windows::Threading::DispatcherOperation<TResult> ^ InvokeAsync(Func<TResult> ^ callback, System::Windows::Threading::DispatcherPriority priority);
public System.Windows.Threading.DispatcherOperation<TResult> InvokeAsync<TResult> (Func<TResult> callback, System.Windows.Threading.DispatcherPriority priority);
member this.InvokeAsync : Func<'Result> * System.Windows.Threading.DispatcherPriority -> System.Windows.Threading.DispatcherOperation<'Result>
Public Function InvokeAsync(Of TResult) (callback As Func(Of TResult), priority As DispatcherPriority) As DispatcherOperation(Of TResult)
Paramètres de type
- TResult
Type de valeur de retour du délégué spécifié.
Paramètres
- callback
- Func<TResult>
Délégué permettant d'appeler via le répartiteur.
- priority
- DispatcherPriority
Priorité qui détermine l’ordre dans lequel le rappel spécifié est appelé par rapport aux autres opérations en attente dans le Dispatcher.
Retours
Objet qui est retourné immédiatement après l'appel de InvokeAsync<TResult>(Func<TResult>, DispatcherPriority) et qui peut être utilisé pour interagir avec le délégué en attente d'exécution dans la file d'attente des événements.