コード例 #1
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            RecyclerViewCommentVerifierHolder viewHolder = holder as RecyclerViewCommentVerifierHolder;

            viewHolder.userName.Text    = comments[position].name;
            viewHolder.date.Text        = comments[position].date;
            viewHolder.comment.Text     = comments[position].comment;
            viewHolder.ratingBar.Rating = (float)comments[position].rating;

            viewHolder.delete.Click += (sender, e) =>
            {
                API.DeleteComment(comments[position].idcomment);
                comments.RemoveAt(position);
                NotifyDataSetChanged();
            };

            viewHolder.noProblem.Click += (sender, e) =>
            {
                API.NotBadComment(comments[position].idcomment);
                comments.RemoveAt(position);
                NotifyDataSetChanged();
            };
        }