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

            // Load the photo caption from the photo album:
            vh.Name.Text    = viewModel.Items[position].Name;
            vh.Country.Text = viewModel.Items[position].Country;
        }
コード例 #2
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            View itemView = LayoutInflater.From(parent.Context).
                            Inflate(Resource.Layout.adapter_item, parent, false);

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

            return(item);
        }