OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { PhotoViewHolder vh = holder as PhotoViewHolder; // Set the ImageView and TextView in this ViewHolder's CardView // from this position in the photo album: vh.Image.SetImageResource(mPhotoAlbum[position].PhotoID); vh.Caption.Text = mPhotoAlbum[position].Caption; }
OnCreateViewHolder(ViewGroup parent, int viewType) { // Inflate the CardView for the photo: View itemView = LayoutInflater.From(parent.Context). Inflate(Resource.Layout.PhotoCardView, parent, false); // Create a ViewHolder to find and hold these view references, and // register OnClick with the view holder: PhotoViewHolder vh = new PhotoViewHolder(itemView, OnClick); return(vh); }