在Windows RT中的ListView中显示缩略图

时间:2013-01-13 19:58:57

标签: c# windows-runtime

我有一个代码来获取缩略图,看起来像这样

public async Task<bool> SetThumbnail(Model.FileInfo Fil)
{
   try
   {
      // Set the File
      var File = await GetStorageFile(Fil);

      // Set the File's thumbnail
      Fil.FileThumbnail = await File.GetThumbnailAsync(Windows.Storage.FileProperties.ThumbnailMode.ListView);

      // Set the File
      Fil.File = File;

      // Return true as it was successfully executed
      return true;
   }
   // Otherwise it was not successful so return false
   catch (Exception e) {
      return false;
   }
}

GetStorageFile方法看起来像这样

private async Task<StorageFile> GetStorageFile(Model.FileInfo FileInf)
{
   // Create (and open the Folder)
   var Folder = await _Folder.CreateFolderAsync(_FilesFolderName, CreationCollisionOption.OpenIfExists);

   // Get the File
   return await Folder.GetFileAsync(FileInf.ID + "." + FileInf.Extension);
}

第一次运行很好,但是当我第二次显示List时,缩略图没有显示

当我第二次跑它时会出现什么问题?

0 个答案:

没有答案