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

InvalidCastException: Xamarin.Forms.BindingExpression issue converting String to ImageSource ?

$
0
0

I'm using a ListView with a custom ViewCell. The ViewCell has an Image for the background and the Image.SourceProperty is bound to an ImageUri property on my model.

As I understand it, there is an implicit conversion for URI's and they are automatically downloaded. The images are downloading and displaying fine, but I'm getting an InvalidCastException each time the Image.SourceProperty is bound. I hardcoded the getter for my ImageUri property to a path to a local image and I still get the exception, even though the image displays fine. Every time a new cell scrolls into view I get the exception. Here is the line from the call stack:

Xamarin.Forms.BindingExpression.TryConvert (part={Xamarin.Forms.BindingExpression.BindingExpressionPart}, value="Stock1.png", convertTo={Xamarin.Forms.ImageSource})


Viewing all articles
Browse latest Browse all 58056

Trending Articles