public UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var startDate = EventDates.ElementAt(indexPath.Section); var dateSessions = Sessions.Where(s => s.Starts.GetValueOrDefault().Date == startDate); var session = dateSessions.ElementAt(indexPath.Row); var sc = tableView.DequeueReusableCell("SessionCell", indexPath) as SessionCell; sc.Configure(session); return(sc); }
public void RowSelected(UITableView tableView, NSIndexPath indexPath) { var sc = (tableView.CellAt(indexPath)); var startDate = EventDates.ElementAt(indexPath.Section); var dateSessions = Sessions.Where(s => s.Starts.GetValueOrDefault().Date == startDate); SelectedSession = dateSessions.ElementAt(indexPath.Row); if (SelectedSession.HasVideo) { PerformSegue("ShowSession", sc); } }
public void DidUpdateFocus(UITableView tableView, UITableViewFocusUpdateContext context, UIFocusAnimationCoordinator coordinator) { var sc = (context.NextFocusedItem as SessionCell); if (sc != null) { var indexPath = tableView.IndexPathForCell(sc); var startDate = EventDates.ElementAt(indexPath.Section); var dateSessions = Sessions.Where(s => s.Starts.GetValueOrDefault().Date == startDate); var session = dateSessions.ElementAt(indexPath.Row); // trackLabel.Text = $"Track: {session.Track ?? "-"}"; startsLabel.Text = $"Starts: {session.Starts.GetValueOrDefault().ToLongTimeString()}"; descriptionTextView.Text = session.CleanBody; } }
public string TitleForHeader(UITableView tableView, nint section) { var startDate = EventDates.ElementAt((int)section); return(startDate.Date.ToLongDateString()); }
public nint RowsInSection(UITableView tableView, nint section) { var startDate = EventDates.ElementAt((int)section); return(Sessions.Count(s => s.Starts.GetValueOrDefault().Date == startDate)); }