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

Binding an ImageCell's Image property

$
0
0

I'm trying to bind an ImageCell's Image property, and I think I'm doing it the right way, but it's not working. Anyone care to show me the error of my ways?

binding:

            LoadList.ItemsSource = ViewModel.Loads;
            LoadList.ItemTemplate = new DataTemplate (typeof(ImageCell))  { 
                Bindings = {
                    { ImageCell.TextProperty, new Binding("Description") },
                    { ImageCell.DetailProperty, new Binding("Subdescription") },
                    { ImageCell.ImageSourceProperty, new Binding("SelectedImage") }
                }};

and in my ViewModel

        public ImageSource SelectedImage { 
            get { 
            return ImageSource.FromResource ("checkmark-32.png");
            } 
        }

"checkmark-32.png" is in my iOS Resources folder, set to "BundledResource". For the moment iOS is the only platform I'm worried about.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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