I am trying to use FFImageLoading
in a ListView
using only XAML and a view model. For each item in the list i have a model and I want to trap when an image fails to load and update a label thats associated with the image in the same model.
<ffimageloading:CachedImage
DownsampleToViewSize="true"
RetryCount="0"
ErrorCommand="{Binding ImageLoadError}"
IsVisible="{Binding HasAttachement}"
Source="{Binding Attachment}">
</ffimageloading:CachedImage>
I thought adding an ErrorCommand
handler thats bound in my model would work except the command is being invoked for every instance of my model and not just the instance where the image loading fails
ImageLoadError = new Command((e) =>
{
Debug.WriteLine($"Image load error Text is {Text}");
});
The above command handler is invoked for every instance of my model and not just the instance attached to the failed image.
How can i get notifications of loading errors to only the instance of my model thats associated with the image?