If you have an image as an embedded resource in the common PCL project and do:
cachedImage.Source = ImageSource.FromResource("ProjectName.Resources.image.png");
in more than one place in the same screen you get the above mentioned exception. The same code works fine in iOS.
Moving the image to the platform projects and getting the image source with ImageSource.FromFile() works fine.
Just add a custom cache key which will always return ProjectName.Resources.image.png for the same file and you're done (only one image loading for the same file will occur). By default StreamImageSource (which ImageSource.FromResource is), uses Stream hash as a key.
OR you can use EmbeddedResourceImageSource which takes care of it for you and generally, has a better performance. Also resource:// string urls are supported.
More here: https://github.com/luberda-molinet/FFImageLoading/wiki/Data-URL-&-Embedded-Resources-support-(including-base64)
Great! If it's not too much trouble can you give some usage examples for people not-so-familiar with .NET ashamed
Just replace ImageSource.FromResource with new EmbeddedResourceImageSource("ProjectName.Resources.image.png")
Most helpful comment
Just replace
ImageSource.FromResourcewithnew EmbeddedResourceImageSource("ProjectName.Resources.image.png")