I'm developing a Xamarin Forms application that needs a ListView with CustomCells 'MyCustomCell'. Cells have a moderate number of bindings (9) and each cell is largely similar so I decided to set the caching strategy to RecycleElement. This list could contain 100 items easily. Each cell contains two images with an Uri source.
I usually bind the view's attributes in my MyCustomCell.xaml, for example with an Image:
<Image
x:Name="MyImage"
Source="{Binding ImageSource}"
.../>
But I recently read this article https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/listview/performance and I was wondering what are the main differences between binding in my MyCustomCell.xaml and in the overrode method 'OnBindingContextChanged' like this:
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
var item = BindingContext as MyModel;
MyImage.Source = ImageSource.FromUri(item.ImageSource);
}
I tested both solutions and the second one seemed faster to me. Am I right ? What are the real differences between these two solutions ?