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

            Document doc = mDocumentsList[position];

            vh.txtDocumentTitle.Text = doc.Name;
            vh.ItemView.Click       += (sender, e) => OnClick(doc);
        }
コード例 #2
0
        // Create a new photo CardView (invoked by the layout manager):
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            View itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.DocumentRow, parent, false);

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

            return(vh);
        }