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

How can I tell if ImageSource.FromFile successfully loaded an image

$
0
0

I have a scenario where I'm dynamically loading images, using ImageSource.FromFile, in my Xamarin Forms project based on strings that I get back from a service call. If I have a graphic with the same name as the string from the service call then the image is loaded. In the case where I don't have a corresponding graphic, the call succeeds but the image is not loaded because it doesn't exist. In this case, I'd like to know that it failed and load a default image, but I cannot seem to find any way to know if it failed - no exception or event. BTW, my images are local images (http://developer.xamarin.com/guides/cross-platform/xamarin-forms/working-with/images/#Local_Images). How might I accomplish this?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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