예제 #1
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            View           itemView   = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.bookView, parent, false);
            BookViewHolder viewHolder = new BookViewHolder(itemView);

            return(viewHolder);
        }
예제 #2
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            BookViewHolder viewHolder = holder as BookViewHolder;

            viewHolder.titleField.Text       = books[position].Title;
            viewHolder.authorField.Text      = books[position].Author;
            viewHolder.publicationField.Text = books[position].Date.ToShortDateString();
            viewHolder.amountField.Text      = "0";


            ((BookViewHolder)holder).Item.Click += Item_Click;
        }