Home>

I can bind it in XAML or name the image and bind it, but I don't know how to bind the image source in C # code as below.

How do I bind the image in the bookList to/* ImageSource */below?

private ObservableCollection<bookData>bookList;
Public class bookData
    {
        public int s_number {get;set;}
        public string title {get;set;}
        public int price {get;set;}
        public int inventory {get;set;}
        public string genre {get;set;}
        public string explanation {get;set;}
        public ImageSource image {get;set;}
    }
Grid grid = new Grid
            {
                RowDefinitions =
                {
                    new RowDefinition {Height = new GridLength (75)},
                    new RowDefinition {Height = new GridLength (1, GridUnitType.Star)},
                }
            };
            grid.Children.Add (new Frame
            {
                BackgroundColor = Xamarin.Forms.Color.White,
                Padding = 5,
                HasShadow = false,
                Content = new Image
                {
                    Source =/* ImageSource * /,
                    Aspect = Aspect.AspectFill,
                    HorizontalOptions = LayoutOptions.Center,
                    VerticalOptions = LayoutOptions.Center,
                    HeightRequest = 80,
                }
            });