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

Unable to get image.setBinding for Image.Sourceproperty to work.

$
0
0

I tried to edit the example in the FormsSample so that it would show a listview of local images.

My model looks like this

    class Mentor
    {
        public Mentor(string name, string profession, string imageResourceId)
        {
            this.Name = name;
            this.Profession = profession;
            this.ImageResourceId = imageResourceId;
        }

        public string Name              { private set; get; }
        public string Profession        { private set; get; }
        public string ImageResourceId   { private set; get; }
    };

and in my DataTemplate, I call

    Image image = new Image () {
            Aspect = Aspect.AspectFit,
    };

    image.SetBinding(Image.SourceProperty, "ImageResourceId");

What is my error that is making the image not appear?


Viewing all articles
Browse latest Browse all 58056

Trending Articles