You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在错误线程调用FilePicker.PickMultipleAsync的问题咨询

在错误线程调用FilePicker.PickMultipleAsync的问题咨询

我看到文档里明确要求FilePicker的所有方法都必须在UI线程调用,所以我写了下面这段调用代码:

await MainThread.InvokeOnMainThreadAsync(async () => {    
    IEnumerable<FileResult> images = await FilePicker.PickMultipleAsync(new PickOptions()    
    {        
        FileTypes = new FilePickerFileType(new Dictionary<DevicePlatform, IEn

注:上述代码还没写完,我主要想请教大家,这种借助MainThread.InvokeOnMainThreadAsync在UI线程调用FilePicker的方式是否正确?有没有什么需要注意的细节或者更优的实现方式?

内容来源于stack exchange

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.08 12:43:17