OnCreateViewHolder(ViewGroup parent, int viewType) { // Inflate the CardView for the photo: View itemView = LayoutInflater.From(parent.Context). Inflate(Resource.Layout.BookListItemRead, parent, false); ReadBoolListHolder vh = new ReadBoolListHolder(itemView, OnClick); return(vh); }
OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { ReadBoolListHolder vh = holder as ReadBoolListHolder; var item = originalBooks[position]; vh.ReadBookTitle.Text = item.Title; vh.ReadBookAuthor.Text = item.Author; if (item.BookPictureUrl != null) { CommonHelper.SetImageOnUIImageView(vh.ReadBookImage, item.BookPictureUrl, context, 600, 600); } Books obitmobEvent = originalBooks[position]; var RemoveBookEvent = new ReadBookRemoveAdapterButtonClickListener(obitmobEvent, context); vh.RemoveButton.SetOnClickListener(RemoveBookEvent); RemoveBookEvent.ListReload += RefreshList; }