public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { var viewHolder = holder as TurnViewHolder; var turn = turns[position]; viewHolder.PersonName.Text = turnsRepository.GetPerson(turn.PersonId).Name; viewHolder.Timestamp.Text = turn.Timestamp.ToShortDateString(); }
private void ReloadPersonTurns() { personTurns = turnsRepository.GetTurnsForActivity(activityId) .GroupBy(t => t.PersonId) .Select(g => new PersonTurns { PersonName = turnsRepository.GetPerson(g.Key).Name, TurnsCount = g.Count(), LatestTurnTimestamp = g.Any() ? g.Max(t => t.Timestamp) : (DateTime?)null }) .OrderByDescending(t => t.TurnsCount) .ThenByDescending(t => t.LatestTurnTimestamp) .ToArray(); }