Unable to detect the selected FileTypeChoice from FileSavePicker

扶醉桌前 提交于 2019-12-11 01:56:29

问题


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.

Please note: Both file type choices have the same extension. The difference between the two is the display name.

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

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


回答1:


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.



来源:https://stackoverflow.com/questions/12218764/unable-to-detect-the-selected-filetypechoice-from-filesavepicker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!