Windows Phone 8.1应用程序选择器

时间:2015-03-09 06:34:14

标签: c# windows-runtime windows-phone-8.1 windows-phone

如何通过代码在WIndows Phone 8.1中显示应用程序选择器?目前我正在使用DisplayApplicationPicker = true,但它无效。任何人都可以给我一个示例代码吗?

2 个答案:

答案 0 :(得分:0)

你几乎在那里:

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

来源: https://msdn.microsoft.com/en-us/library/windows/apps/windows.system.launcheroptions.displayapplicationpicker.aspx

答案 1 :(得分:0)

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();