public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { ArivalViewHolder vh = holder as ArivalViewHolder; // Load the photo image resource from the photo album: vh.Header.Text = mPhotoAlbum[position].name; // vh.Time.Text = DateTime startTime = mPhotoAlbum[position].Date; DateTime endTime = DateTime.Now; TimeSpan span = startTime.Subtract(endTime); var totalminues = Math.Round(span.TotalMinutes); vh.Time.Text = totalminues.ToString(); // Load the photo caption from the photo album: if (mPhotoAlbum[position].direction != null) { vh.Caption.Text = mPhotoAlbum[position].direction; } }
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { // Inflate the CardView for the photo: View itemView = LayoutInflater.From(parent.Context). Inflate(Resource.Layout.FavoritsListView, parent, false); // Create a ViewHolder to hold view references inside the CardView: ArivalViewHolder vh = new ArivalViewHolder(itemView, OnClick, OnLongClick); return(vh); }