我正在尝试为 FileOpenPicker 设置建议的位置。我是这样做的:
var openPicker = new FileOpenPicker();
openPicker.SuggestedStartLocation = PickerLocationId.Downloads;
openPicker.FileTypeFilter.Add("*");
它在 WinRT 上运行良好,我直接获取Downloads
文件夹。但是在windows phone上它不起作用。而不是获取Downloads
要选择的默认文件夹的显示列表。经过一段时间修复这个问题我发现,如果我会FileTypeFilter
这样设置:
var openPicker = new FileOpenPicker();
openPicker.SuggestedStartLocation = PickerLocationId.MusicLibrary;
openPicker.FileTypeFilter.Add(".jpg");
它会打开PictureLibrary
。有趣的是,它与我设置的内容无关SuggestedStartLocation
,它会一直如此PictureLibrary
。以前有人遇到过这个问题吗?我将不胜感激任何建议!