1
我想注册一个打开文件并处理它的异步命令。来自ReactiveAsyncCommand的UI访问
OpenFileCommand = new ReactiveAsyncCommand();
OpenFileCommand.RegisterAsyncAction(_ =>
{
var path = GetOpenFilePath(); // This needs to be on the UI thread
if (String.IsNullOrEmpty(path))
return;
ProcessFile(path);
});
这个问题
Asynchronous command execution with user confirmation
相似,但我不知道如何在这里适用这个问题的答案。我需要将路径值传递给处理器。
我该怎么做?
我目前正在使用对话服务的接口,我只是没有在简单的问题中包括它。目前虽然它只返回一个字符串,而不是任务或可观察的。太好了,谢谢! –