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); NaoPreferenciaViewHolder vh = new NaoPreferenciaViewHolder(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 nPref = NaoPreferencias[position]; Console.WriteLine(holder); NaoPreferenciaViewHolder vh = holder as NaoPreferenciaViewHolder; vh.Alimento.Text = nPref.DesignacaoAlimento; vh.Ingrediente.Text = nPref.DesignacaoIngrediente; }