public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { // instantiates the item layout file and the view holder View itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.PreferenciaCardView, parent, false); PreferenciaViewHolder vh = new PreferenciaViewHolder(itemView, OnClick); return(vh); }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { // loads the data at the specified position into the views whose // references are stored in the given view holder Preferencia pref = Preferencias[position]; Console.WriteLine(holder); PreferenciaViewHolder vh = holder as PreferenciaViewHolder; vh.Alimento.Text = pref.DesignacaoAlimento; vh.Ingrediente.Text = pref.DesignacaoIngrediente; }