Esempio n. 1
0
        OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            ItemViewHolder itemViewHolder = holder as ItemViewHolder;

            // Set the ImageView and TextView in this ViewHolder's CardView
            // from this position in the item list:
            //itemViewHolder.Image.SetImageResource(mPhotoAlbum[position].PhotoID);

            itemViewHolder.Name.Text      = mItem[position].Name;
            itemViewHolder.Price.Text     = "R" + mItem[position].Price;
            itemViewHolder.Condition.Text = mItem[position].Condition;
        }
Esempio n. 2
0
        OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            // Inflate the CardView for the item:
            View itemView = LayoutInflater.From(parent.Context).
                            Inflate(Resource.Layout.ItemCard, parent, false);

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

            return(itemViewHolder);
        }