C# Windows Phone 8.1应用程序选择器

C# Windows Phone 8.1应用程序选择器,c#,windows-runtime,windows-phone-8.1,windows-phone,C#,Windows Runtime,Windows Phone 8.1,Windows Phone,如何在WIndows Phone 8.1中通过代码显示文件的应用程序选择器?目前我使用的是DisplayApplicationPicker=true,但它不起作用。有人能给我一个示例代码吗?你的where几乎在那里: // Set the option to show the picker var options = new Windows.System.LauncherOptions(); options.DisplayApplicationPicker = true;

如何在WIndows Phone 8.1中通过代码显示文件的应用程序选择器?目前我使用的是
DisplayApplicationPicker=true
,但它不起作用。有人能给我一个示例代码吗?

你的where几乎在那里:

// Set the option to show the picker
      var options = new Windows.System.LauncherOptions();
      options.DisplayApplicationPicker = true;
资料来源:

FileOpenPicker filePicker = new FileOpenPicker();
filePicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
filePicker.ViewMode = PickerViewMode.Thumbnail;

// Filter to include a sample subset of file types
filePicker.FileTypeFilter.Clear();
filePicker.FileTypeFilter.Add(".bmp");
filePicker.FileTypeFilter.Add(".png");
filePicker.FileTypeFilter.Add(".jpeg");
filePicker.FileTypeFilter.Add(".jpg");

filePicker.PickSingleFileAndContinue();