FFImageLoading
FFImageLoading copied to clipboard
Events only fire once on multiple images if they have the same source
I'm not sure if this is intended behaviour, but setting a Finish event (and assumedly others) on multiple images only fires once if the images have the same source. If the images have a different source then they each fire their own Finish event.
@ahohns I am sorry I have not clearly understood. Could you write an example?
@molinch Sure:
var ImageA = new CachedImage { Source = ImageSource.FromFile("file1.jpg") };
ImageA.Finished += (sender, e) => { Console.WriteLine("ImageA Finished"); };
var ImageB = new CachedImage { Source = ImageSource.FromFile("file1.jpg") };
ImageB.Finished += (sender, e) => { Console.WriteLine("ImageB Finished"); };
var ImageC = new CachedImage { Source = ImageSource.FromFile("file2.jpg") };
ImageC.Finished += (sender, e) => { Console.WriteLine("ImageC Finished"); };
var ImageD = new CachedImage { Source = ImageSource.FromFile("file3.jpg") };
ImageD.Finished += (sender, e) => { Console.WriteLine("ImageD Finished"); };
Will Output:
ImageA Finished
ImageC Finished
ImageD Finished
ImageB never outputs because it's the same file source as ImageA.
Yes you are right, B will wait for A to finish, and currently it won't call callbacks. It shouldn't be too difficult to change.