【发布时间】:2015-09-17 05:59:51
【问题描述】:
我不明白如何将这段代码翻译成 f#:
var x = await Application.Current.Dispatcher.InvokeAsync(c);
// the type of c is Func<int>
如果我尝试这样做
let x = Async.AwaitTask(Application.Current.Dispatcher.InvokeAsync(c))
我有一个编译器错误:
Threading.DispatcherOperation<int> is not compatible with Task<int>
怎么做?
【问题讨论】:
-
InvokeAsync的类型是什么?
标签: wpf f# task-parallel-library dispatcher