示例代码应该显示选择目标应用程序来启动文件。
文档来自:https://learn.microsoft.com/windows/uwp/launch-resume/launch-the-default-app-for-a-file
var file = await MyLibrary.UWP.StorageItemPicker.OpenSingleFileAsync(".mp3");
if (file != null)
{
// Set the option to show the picker
var options = new Windows.System.LauncherOptions();
options.DisplayApplicationPicker = true;
//options.LimitPickerToCurrentAppAndAppUriHandlers = true;
// Launch the retrieved file
bool success = await Windows.System.Launcher.LaunchFileAsync(file, options);
if (success)
{
// File launched
}
else
{
// File launch failed
}
}
但是我的应用程序中的代码无法运行,它没有显示她的选择器 ui,文件也无法启动。
我该如何解决?