public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath)
            {
                var cell = collectionView.DequeueReusableCell(_reuseIdentifier, indexPath);

                if (cell == null)
                {
                    throw new Exception("Invalid reuseIdentifier");
                }
                var rCell = cell as IReusableView <T>;

                if (rCell == null)
                {
                    throw new Exception("Your cell most implement IReusableView<T> or " +
                                        "derive from CollectionViewCell");
                }


                rCell.CrossCellModel = _crossCellModel;
                _del?.OnCreate(cell, collectionView);
                _crossCellModel?.OnCreate();

                rCell.Model = GetItem((int)indexPath.Item);

                if (_centreCell != null)
                {
                    CentreCell();
                }

                return((UICollectionViewCell)cell);
            }
Пример #2
0
            public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
            {
                var cell = tableView.DequeueReusableCell(_reuseIdentifier, indexPath);

                if (HasHeader && indexPath.Row == 0)
                {
                    cell = GetHeaderCell();
                }

                if (HasFooter && indexPath.Row == Count - 1)
                {
                    cell = GetFooterCell();
                }

                if (cell == null)
                {
                    throw new Exception("Invalid reuseIdentifier");
                }

                rCell = cell as IReusableView <T>;
                if (rCell == null)
                {
                    throw new Exception("Your cell most implement IReusableView<T> or " +
                                        "derive from TableViewCell");
                }

                rCell.CrossCellModel = _crossCellModel;

                _del?.OnCreate(cell, tableView, _crossCellModel);
                _crossCellModel?.OnCreate();

                rCell.Count      = Count;
                rCell.Navigate   = AppTools.RootNavigationController;
                rCell.Storyboard = AppTools.Storyboard;
                rCell.Position   = indexPath.Row;
                rCell.TableView  = tableView;
                rCell.Model      = GetItem(indexPath.Row);

                if (_vertical)
                {
                }

                return(cell);
            }