コード例 #1
0
        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);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
        public string TitleForHeader(UITableView tableView, nint section)
        {
            var startDate = EventDates.ElementAt((int)section);

            return(startDate.Date.ToLongDateString());
        }
コード例 #5
0
        public nint RowsInSection(UITableView tableView, nint section)
        {
            var startDate = EventDates.ElementAt((int)section);

            return(Sessions.Count(s => s.Starts.GetValueOrDefault().Date == startDate));
        }