Skip to content

Languages

This page is also available in 简体中文 and 日本語.

[AsyncDelegateCommand]

Use for Task-based async methods when you need Prism-style options:

  • EnableParallelExecution
  • CancelAfter
  • Catch (exception handler — PSG2001 / PSG2002 if invalid)
  • ObservesCanExecute (or pair with [ObservesProperty] on [DelegateCommand])
  • CancellationTokenSourceFactory (where supported)
csharp
[AsyncDelegateCommand(EnableParallelExecution = true)]
private async Task FetchAsync() { }

[AsyncDelegateCommand(CanExecute = nameof(CanSave), Catch = nameof(HandleError))]
private async Task SaveAsync() { }

Prism 8 vs 9

  • Prism 9+: AsyncDelegateCommand ships with Prism.
  • Prism.Core 8.1.97: install MvvmAIO.Prism.Bcl.Commands so the symbol exists; otherwise PSG3002.

Released under the MIT License.

Released under the MIT License.