question

EJ-5254 avatar image
0 Votes"
EJ-5254 asked ColeXia-MSFT edited

Deleting items in CarouselView

Hi,

I've a CarouselView in which I only want to have 3 items at a time, so when 4th item is added I want to delete first one and so on. This is for email app as each email can be big in size so don't want to hold many items in CarouselView.

The way I'm doing this is by using CurrentItemChanged event to add next email when user scrolls to last one. If item count exceeds 3 then I delete first one. All works fine, except when I delete the first item scroll animation stops. I guess this happens because CurrentItemChanged is raised before item is fully snapped into position?

My question is how can I avoid this? Is there an event when item changed and scrolling is completely stopped?

Thanks in advance.

dotnet-xamarin
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I suggest that modify the list item instead of deleting/readding it while scrolling , otherwise it will cause unexpected problem .

0 Votes 0 ·

Hi,

Are you suggesting clearing list item data instead of deleting item from the list? Sorry, just want to make sure I understand this correctly. :)

I use this in CarouselView to display emails so each item will have WebView, I wonder even if I clear data if CarouselView ends up with 20-30 empty WebView's could this potentially use too much memory?

0 Votes 0 ·

If possible could you provide us a basic sample to test ? We need more information to troubleshoot the issue .

0 Votes 0 ·

0 Answers