Ejemplo n.º 1
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            var position = indexPath.Row;
            var typeIdx  = GetItemViewType(position);
            var cell     = tableView.DequeueReusableCell(typeIdx.ToString());

            if (cell == null)
            {
                var view = CreateView(position, ViewHierarchyBuilder.Instance);
                cell = TableViewUtil.ToTableViewCell(view);
            }
            if (cell is UITableViewCellAdapter)
            {
                _item.PlatformView = ((UITableViewCellAdapter)cell).CellView;
            }
            else
            {
                _item.PlatformView = cell;
            }
            FillView(position, _item);
            return(cell);
        }
Ejemplo n.º 2
0
        public UIView GetViewForHeader(UITableView tableView, nint section)
        {
            var prefix    = "Header";
            var group     = (int)section;
            var groupType = GetGroupType(group);
            var groupView = tableView.DequeueReusableHeaderFooterView(prefix + groupType.ToString());

            if (groupView == null)
            {
                var qGroupView = CreateGroupView(group, ViewHierarchyBuilder.Instance);
                groupView = TableViewUtil.ToTableViewHeaderFooter(qGroupView);
            }
            if (groupView is UITableViewHeaderFooterViewAdapter)
            {
                _section.PlatformView = ((UITableViewHeaderFooterViewAdapter)groupView).View;
            }
            else
            {
                _section.PlatformView = groupView;
            }
            FillGroupView(group, _section);
            return(groupView);
        }
Ejemplo n.º 3
0
        public sealed override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            var child  = indexPath.Row;
            var @group = indexPath.Section;

            var id   = GetChildType(@group, child);
            var cell = tableView.DequeueReusableCell(id.ToString());

            if (cell == null)
            {
                var listItem = CreateChildView(@group, child, ViewHierarchyBuilder.Instance);
                cell = TableViewUtil.ToTableViewCell(listItem);
            }
            if (cell is UITableViewCellAdapter)
            {
                _item.PlatformView = ((UITableViewCellAdapter)cell).CellView;
            }
            else
            {
                _item.PlatformView = cell;
            }
            FillChildView(@group, child, _item);
            return(cell);
        }