What are the best practices now used to copy a large file with progress in UI applications? I am not interested in the components on the form, but in the copying process itself. The requirements are as follows:

  1. reduce wasted resources
  2. copying should not block the main UI stream
  3. copying progress should be displayed on the form

Found FileStream.CopyToAsync , but with its help, it seems, not to display progress. Thank you in advance

  • one
    Copy manually block by ReadAsync / WriteAsync? - VladD
  • BackgroundWorker class here is a link to the example of professorweb.ru/my/WPF/documents_WPF/level31/31_3.php - Gardes
  • 2
    The Task-based Asynchronous Pattern by Stephen Toub is a free asynchronous book by the guru of the dotnet. At the end are various examples of asynchronous copying, including progress. - Alexander Petrov
  • one
  • one
    In short: 1024 bytes are a quarter of the page size. This means that the data that the OS loads from the lawsuit at a time is read in 4 steps. Of course, it is slow! You need to read at least a dozen pages at a time. - Pavel Mayorov

0