Example #1
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            CustomerViewHolder vh = holder as CustomerViewHolder;

            // Set the TextViews in this ViewHolder's CardView
            // from this position in the list of customers:
            vh.customerName.Text = listOfCustomers[position].Company;
        }
Example #2
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            View itemView = LayoutInflater.From(parent.Context).
                            Inflate(Resource.Layout.CustomerCardView, parent, false);

            // Create a ViewHolder to find and hold these view references, and
            // register OnClick with the view holder:
            CustomerViewHolder vh = new CustomerViewHolder(itemView, OnClick);

            return(vh);
        }