C# 在Windows 8应用商店应用程序中使用FileOpenPicker在页面启动时浏览您自己的资源目录

C# 在Windows 8应用商店应用程序中使用FileOpenPicker在页面启动时浏览您自己的资源目录,c#,windows,xaml,windows-store-apps,windows-8.1,C#,Windows,Xaml,Windows Store Apps,Windows 8.1,我有一个Windows8商店应用程序页面(比如PhotoPage.xaml)。 在我的应用程序中,我在“资产\图像”中有一个嵌入式图像资源文件夹,其中有许多图像 在“PhotoPage.xaml”页面的页面加载中,是否有方法填充此图像文件夹中的所有图像 我尝试了FileOpenPicker,但我想我无法在SuggestedStartLocation上浏览自定义文件夹 以下是我尝试过的: Windows.Storage.Pickers.FileOpenPicker openPicker = ne

我有一个Windows8商店应用程序页面(比如PhotoPage.xaml)。 在我的应用程序中,我在“资产\图像”中有一个嵌入式图像资源文件夹,其中有许多图像

在“PhotoPage.xaml”页面的页面加载中,是否有方法填充此图像文件夹中的所有图像

我尝试了
FileOpenPicker
,但我想我无法在
SuggestedStartLocation
上浏览自定义文件夹

以下是我尝试过的:

Windows.Storage.Pickers.FileOpenPicker openPicker = new Windows.Storage.Pickers.FileOpenPicker();
openPicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.PicturesLibrary;
根据PickerLocationId只能有几个位置

那么,在我的PhotoPage.xaml页面启动(页面加载)时,是否有办法浏览我的图像文件夹呢

感谢您的帮助


谢谢和问候,

我认为您不需要使用
FileOpenPicker
。如果您想填充所有图像,只需获取images文件夹并迭代其内容即可

var installedLocation=Windows.ApplicationModel.Package.Current.installedLocation;
var images=await installedLocation.GetFolderAsync(“资产\\图像”);
var items=wait images.GetItemsAsync();
foreach(项目中的var项目)
{
//TODO:将图像添加到页面
}