0

I excerpt from windows 8.1 sample of StorageDataSource and GetVirtualizedFilesVector sample a piece of code in my project can run successfully, but I changed to this: From ApplicationData.current.localFolder the deposit into my pictures do not show up success

protected override void OnNavigatedTo(NavigationEventArgs e)
{
        var queryOptions = new QueryOptions();
        queryOptions.FolderDepth = FolderDepth.Deep;
        queryOptions.IndexerOption = IndexerOption.UseIndexerWhenAvailable;
        queryOptions.SortOrder.Clear();
        var sortEntry = new SortEntry();
        sortEntry.PropertyName = "System.FileName";
        sortEntry.AscendingOrder = true;
        queryOptions.SortOrder.Add(sortEntry);

        //var fileQuery = KnownFolders.PicturesLibrary.CreateFileQueryWithOptions(queryOptions);
        var fileQuery = ApplicationData.Current.LocalFolder.CreateFileQueryWithOptions(queryOptions);
        const uint size = 400; // default size for PicturesView mode
        var fileInformationFactory = new FileInformationFactory(fileQuery, ThumbnailMode.PicturesView, size, ThumbnailOptions.UseCurrentScale, true);
        itemsViewSource.Source = fileInformationFactory.GetVirtualizedFilesVector();
}

Commented that the original sample code, comments, following the line of code that I want to be able to run. thanks a lot!

1 Answers1

0

Do you have accessright for picture library? To do the programatic access like your code, The app should have it. You can on/off it from Package.appxmanifest.

Mamoru Satoh
  • 2,670
  • 23
  • 23