I have a problem with a Xamarin forms app crashing in Android after getting images from the web. Everything works fine if I use this code:
Image myImage = new Image
{
Source = ImageSource.FromUri(new Uri(myObj.ImagePath1)),
};
When I get the images for a listview using a custom renderer for an image cell is crashes pretty quickly.
This is my code for the listview with databindings
listView.ItemTemplate = new DataTemplate
(typeof(MyImageCell))
Bindings = {
{TextCell.TextProperty,
new Binding("MyTitle")},
{TextCell.DetailProperty,
new Binding("MyAddress")},
{ImageCell.ImageSourceProperty,
new Binding("MyURL")},
}
};
I am new to C# and all things Xamarin and I have no idea how I declare it like the first example and still use it in the binding code. I have tried many different ways but nothing seems to work. Hopefully it something simple that I am missing.
Cheers