I need to execute async delete operation with user confirmation. Something like this:
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
}
}
The problem is the MessageBox would execute asynchronously too. Which is the best pattern in ReactiveUI to ask user synchronously and then execute method asynchronously?