public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { // Inflate the CardView for the photo: View itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.PersonInChargeRow, parent, false); // Create a ViewHolder to find and hold these view references, and // register OnClick with the view holder: PersonInChargeViewHolder vh = new PersonInChargeViewHolder(itemView); return(vh); }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { PersonInChargeViewHolder vh = holder as PersonInChargeViewHolder; PersonGuard personGuard = mPersonInChargeList[position]; vh.txtNameTitle.Text = personGuard.NombreApellido; for (int i = 0; i < personGuard.ContactTypes.Count; i++) { ContactType contactType = personGuard.ContactTypes[i]; // This flag is using to remove the separator line in the last row bool isLastRowInSection = i == personGuard.ContactTypes.Count - 1 ? true : false; vh.addSection(contactType, isLastRowInSection, OnClick); } }