示例#1
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            // Inflate the CardView for the photo:
            View itemView = LayoutInflater.From(parent.Context).
                            Inflate(Resource.Layout.ChoreCardView, parent, false);

            // Create a ViewHolder to hold view references inside the CardView:
            ChoreViewHolder vh = new ChoreViewHolder(itemView, OnClick);

            return(vh);
        }
示例#2
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            ChoreViewHolder vh = holder as ChoreViewHolder;

            // Load the Chore Name from the container:
            vh.Name.Text = choreCollection[position].name;
            // Load the Chore Date from the container:
            vh.Date.Text = choreCollection[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;
        }