Попробуйте это для размера: http://amazedsaint.blogspot.com/2010/10/asynchronous-delegate-command-for-your.html. Отлично подходит для тестирования, так как ни один из ваших методов не должен быть асинхронным, вы просто выполняете свою асинхронную команду.
Я немного отредактировал его, чтобы расширить DelegateCommand, чтобы я мог вызывать метод RaiseCanExecuteChanged (), как показано ниже:
public class AsyncDelegateCommand : DelegateCommand, ICommand
{
BackgroundWorker _worker = new BackgroundWorker();
Func<bool> _canExecute;
/// <summary>
/// The constructor
/// </summary>
/// <param name="action">The action to be executed</param>
/// <param name="canExecute">Will be used to determine if the action can be executed</param>
/// <param name="completed">Will be invoked when the action is completed</param>
/// <param name="error">Will be invoked if the action throws an error</param>
public AsyncDelegateCommand(Action action,
Func<bool> canExecute = null,
Action<object> completed = null,
Action<Exception> error = null
) : base(action, canExecute)
{
...
}
}
Надеюсь, это поможет.