我需要在用户确认的情况下执行异步删除操作。像这样的东西:
public ReactiveAsyncCommand DeleteCommand { get; protected set; }
...
DeleteCommand = new ReactiveAsyncCommand();
DeleteCommand.RegisterAsyncAction(DeleteEntity);
...
private void DeleteEntity(object obj)
{
if (MessageBox.Show("Do you really want to delete this entity?", "Confirm", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
//some delete operations
}
}
问题是 MessageBox 也会异步执行。ReactiveUI 中同步询问用户然后异步执行方法的最佳模式是什么?