Form UI Freeezes even after using Backgroundworker when using Flickr.Net API

后端 未结 2 1434
南笙
南笙 2021-01-28 01:00

Im trying to upload some images using the Flickr.net API.The Images are uploaded but the User Interface freezes.I have inserted the code for uploading in a Background worker

2条回答
  •  爱一瞬间的悲伤
    2021-01-28 01:35

    If you are doing something like:

    while(worker.IsBusy)
    {
    }
    

    to wait for it to finish, this will hang because it ties up the UI thread in the loop and since the background worker needs to invoke onto the UI thread to set the busy property safely there is a dead lock.

提交回复
热议问题