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 = string.Format("{0} {1}", viewModel.Items[position].Name, viewModel.Items[position].Surname); vh.Country.Text = viewModel.Items[position].Country; }
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); }