How to maintain a downloading progress of list view item in Xamarin Forms

cherantcherant USMember ✭✭
edited September 8 in Xamarin.Forms

I am using ListView that contains item template to show book information with download button ( Contains Image of book, Title, Author and button to download book).

Need to show download progress while click download button of each book. I have managed progress value in separate class and used that separate class object to maintain progress of each book in collection. Like below,

When scrolling the page download progress value for downloading books becomes null. For example in the above screenshot, download progress value shown null when scroll the view. Could you please suggest on this?

Answers

  • N_BauaN_Baua INMember ✭✭✭✭✭

    Hi @cherant ,
    Ideally that shouldn't happen if you use the Async calls, However SyncF controls are weird, I too have some super silly things pending in bucket with them. First check if your downloading method call are not executing in the main thread, because it can be the reason I can think of right now for your UI is not working as expected.

  • cherantcherant USMember ✭✭

    Hi @N_Baua ,
    Thanks for your update.

    I have used Microsoft List View only. Async calls only used for every button click. Downloading method calls are not executing in Main thread. I have bind the progress value into progressbar in xaml and now progress shows properly.

  • N_BauaN_Baua INMember ✭✭✭✭✭

    Hi @cherant ,

    Did it solved now?

  • JohnHardmanJohnHardman GBUniversity ✭✭✭✭✭

    @cherant - You'll need to post the code for your view model and page, including the template for the ViewCell, for anybody to identify the cause. Without the code, my guess would be that ListView caching is resulting in re-use of a cell, or alternatively that ListView caching is resulting in something being freed up.

  • cherantcherant USMember ✭✭

    Hi @N_Baua ,

    Yes, now issue resolved. Issue occurred because set caching strategy as Recycle element for list view to improve performance. I have bind download property into ProgressBar panel.

Sign In or Register to comment.