无法从 FileSavePicker 中检测到选定的 FileTypeChoice [英] Unable to detect the selected FileTypeChoice from FileSavePicker

查看:18
本文介绍了无法从 FileSavePicker 中检测到选定的 FileTypeChoice的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让用户在选择文件类型时选择一个保存选项.选择工作正常,如下例所示.但是,在用户选择了要保存的文件类型后,我还没有找到检查他选择了哪种类型的可能性.

I would like to let the user choose a save option while selecting a file type. The selection works fine as in the below example. However after the user has selected a file type to be saved, I have not found a possibility to check which type he has selected.

请注意:两种文件类型选择具有相同的扩展名.两者的区别在于显示名称.

var fsp = new FileSavePicker();

fsp.FileTypeChoices.Add("my file type", new List<string> {".extension"});
fsp.FileTypeChoices.Add("my file type (special)",new List<string>{".extension"});

StorageFile sf = await fsp.PickSaveFileAsync();

// How to know here which FileTypeChoice the user has selected

有没有人知道如何获得选定的 FileTypeChoice?

Has anyone an idea how I can get the selected FileTypeChoice?

推荐答案

我不认为你可以.这里的问题是两者之间的唯一区别是显示名称.我强烈建议使用相似但不同的文件扩展名.你在这里得到的是一个没有任何证据的区别.这使得系统或用户都无法区分 A 型和 B 型.

I don't think you can. The problem here is that the only difference between the two is the display name. I'd highly recommend using similar but distinct file extensions. What you have here is a distinction without any evidence. This makes it impossible for either the system or the user to distinguish between Type A and Type B.

这篇关于无法从 FileSavePicker 中检测到选定的 FileTypeChoice的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆