public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { // Inflate the CardView for the photo: View itemView = LayoutInflater.From(parent.Context). Inflate(Resource.Layout.ServiceCardView, parent, false); // Create a ViewHolder to hold view references inside the CardView: ServiceViewHolder vh = new ServiceViewHolder(itemView, OnClick); return(vh); }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { ServiceViewHolder vh = holder as ServiceViewHolder; // Load the Service Name from the container: vh.Name.Text = serviceCollection[position].name; // Load the Service Date from the container: vh.Date.Text = serviceCollection[position].date; // Load the photo image resource from the photo album: // vh.Image.SetImageResource(mPhotoAlbum[position].PhotoID); // Load the photo caption from the photo album: // vh.Caption.Text = mPhotoAlbum[position].Caption; }