locked
MRU, StorageFolder and FileInformationFactory

    Question

  • Hi,

     Here is my scenario in my app.

      I am using a folder MRU to pick a user recently selected folder and show the thumbnails in my gridview from that folder. Here is my code..

     

    concurrency::create_task(Windows::Storage::AccessCache::StorageApplicationPermissions::MostRecentlyUsedList->GetFolderAsync(token)).then([=](StorageFolder^ tokenFolder)
    	{
    		auto latestFileQuery = tokenFolder->CreateFileQueryWithOptions(queryOptions);
    		auto latestFileInformationFactory = ref new FileInformationFactory(latestFileQuery, ThumbnailMode::VideosView, 150, ThumbnailOptions::ResizeThumbnail, true);
    		Platform::Object^ data= latestFileInformationFactory->GetVirtualizedFilesVector();

    and I bind this data to gridview. But I am not getting the thumbnails of files shown in gridview. Any ideas?

    If I directly query the folderfrom known location (pictures or videos folder), the thumbnails show fine in gridview.

    Sunday, August 05, 2012 5:52 AM

All replies

  • Anyone?
    Monday, August 06, 2012 6:16 PM
  • How did you binding your gridview? You should use the Grid->ItemsSource = dataSource

    And before binding, you should make sure the datasource is not empty. Please follow this document
    http://blogs.msdn.com/b/ukmsdn/archive/2012/04/26/developing-metro-apps-using-c-cx-for-c-developers.aspx

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, August 07, 2012 8:53 AM
  • Yes I am using the correct call. My gridview works fine if I bind to Pictures or videos library. Its that when I query a folder other than these two libraries which I have permissions using the file picker MRU, I am not getting any data in my gridview..

    Question: If I saved a token for a folder and reopen that folder (like below) and call Fileinformationfactory on that folder does that work?

    concurrency::create_task(Windows::Storage::AccessCache::StorageApplicationPermissions::MostRecentlyUsedList->GetFolderAsync(token)).then([=](StorageFolder^ tokenFolder)
    {
    auto latestFileQuery = tokenFolder->CreateFileQueryWithOptions(queryOptions);
    auto latestFileInformationFactory = ref new FileInformationFactory(latestFileQuery, ThumbnailMode::VideosView, 150, ThumbnailOptions::ResizeThumbnail, true);
    Platform::Object^ data= latestFileInformationFactory->GetVirtualizedFilesVector();

    Tuesday, August 07, 2012 6:23 PM
  • anyone from the C++ team?
    Wednesday, August 08, 2012 11:00 PM
  • Ping?
    Thursday, August 09, 2012 7:58 PM