Hi,
So, I have a ListView with custom ViewCell containing an Image and I've created a class called RateObject that looks like this:
`
public class RateObject
{
public String ImagePath {
get;
set;
}
[Ignore]
public ImageSource ImageSource {
get;
set;
}
}
`
I use the [Ignore] annotation so that I can save the object to the database using SQLite ORM and I set the ImageSource when I have fetched the object from the database using the ImagePath.
So far so good, but the problem seem to be when I in my custom ViewCell, RateCell is trying to set the image.SourceProperty, it will not display an image. Why is that? I don't know, guessing it has to do with the [Ignore] annotation maybe?
`
public class RateCell : ViewCell
{
StackLayout rootCellView;
Image image;
public RateCell ()
{
image = new Image {
HeightRequest = 50,
WidthRequest = 50
};
image.SetBinding(Image.SourceProperty, "ImageSource");
rootCellView = new StackLayout{
Orientation = StackOrientation.Horizontal,
Children = {image}
};
View = rootCellView;
}
}
`
Anyone know how to work around this?
(Code annotation seems bugged in the forum )
Thanks,
Bobby Kristensen