protected override object GetItemAt(NSIndexPath indexPath)
        {
            if (!UseGrouping && SuggestCreation)
            {
                var index = (int)indexPath.Item - 1;
                if (index < 0)
                {
                    return(GetCreateSuggestionItem());
                }
                if (ShouldShowNoTagsInfoMessage)
                {
                    return(noTagsInfoMessage);
                }
                if (ShouldShowNoProjectsInfoMessage)
                {
                    return(noProjectsInfoMessge);
                }

                var newIndexPath = NSIndexPath.FromRowSection(indexPath.Section, index);
                return(GroupedItems.ElementAtOrDefault(indexPath.Section)?.ElementAtOrDefault(index));
            }

            if (ShouldShowNoTagsInfoMessage)
            {
                return(noTagsInfoMessage);
            }
            if (ShouldShowNoProjectsInfoMessage)
            {
                return(noProjectsInfoMessge);
            }

            return(base.GetItemAt(indexPath));
        }
Exemple #2
0
        protected override object GetItemAt(NSIndexPath indexPath)
        {
            if (!SuggestCreation)
            {
                return(base.GetItemAt(indexPath));
            }

            if (indexPath.Section == 0)
            {
                return(GetCreateSuggestionItem());
            }

            return(GroupedItems.ElementAtOrDefault(indexPath.Section - 1)?.ElementAtOrDefault((int)indexPath.Item));
        }
Exemple #3
0
 protected override IEnumerable <TimeEntryViewModel> GetGroupAt(nint section)
 => GroupedItems.ElementAtOrDefault((int)section);