Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Caching of ListView cells?

$
0
0

Hi,
I was experimenting with Xamarin Forms, converting an existing application over to see how it runs. The app consists of a UITableView that displays a scrolling list of cells that includes images and text. Under iOS, this performs well due to reuse of UITableViewCells, however, with my first attempt with Xamarin Forms, this performs ok(ish), but far from optimal. Part of the reason I think is because each cell is created in the data template for every item, which is an expensive operation.

I tried to see if I could override the behavior of the DataTemplate class, so that I could add some caching behavior, but I don't think you can do do anything with it. I was also hoping that on the ListView's ItemDisappearing event, that I would be able to get a reference to the cell that is being removed, so that I could cache it, but no luck. Looking at WPF, I found this: http://stackoverflow.com/questions/3480886/wpf-datatemplate-performance, but that of course won't be able to help me here.

Has anybody found a workaround to improve the performance of the ListView cells and DataTemplate?

thanks,
Dennis


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>