locked
Reporting Progress on GetFilesAsync

    Question

  • Is there a way to report progress when calling GetFilesAsync on a StorageFolder? 

    Example : 

    var musicFolder = KnownFolders.MusicLibrary;
    var storageFiles = (await musicFolder.GetFilesAsync(CommonFileQuery.OrderByName)).ToList();

    In this case I have to wait until all files are returned. I want to be able to call await musicFolder.GetFilesAsync(CommonFileQuery.OrderByName) and get notified every time "n" files are loaded. 

    Thank you


    Simple is better

    Sunday, April 13, 2014 1:28 PM

Answers

  • Hi Paul,

    I don't think GetFilesAsync() can return a progress property, the IAsyncOperation<IVectorView> is returned only contains Completed property unlike ProgressRing classfor your clients when they are waiting, it is a good choice for representing that an operation is ongoing.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, April 14, 2014 6:26 AM
    Moderator