【发布时间】:2012-09-06 10:10:06
【问题描述】:
我需要在用户确认的情况下执行异步删除操作。像这样的:
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 中同步询问用户然后异步执行方法的最佳模式是什么?
【问题讨论】:
标签: c# .net mvvm system.reactive reactiveui