Beispiel #1
0
        private IPriceTileCell GetCell(UITableView tableView, PriceTileModel model)
        {
            IPriceTileCell priceTileCell = null;

            switch (model.Status)
            {
            case PriceTileStatus.Done:
            case PriceTileStatus.DoneStale:
                priceTileCell = tableView.DequeueReusableCell(PriceTileTradeAffirmationViewCell.Key) as PriceTileTradeAffirmationViewCell;
                if (priceTileCell == null)
                {
                    priceTileCell = PriceTileTradeAffirmationViewCell.Create();
                }
                break;

            case PriceTileStatus.Streaming:
            case PriceTileStatus.Executing:
                priceTileCell = tableView.DequeueReusableCell(PriceTileViewCell.Key) as PriceTileViewCell;
                if (priceTileCell == null)
                {
                    priceTileCell = PriceTileViewCell.Create();
                }
                break;

            case PriceTileStatus.Stale:
                priceTileCell = tableView.DequeueReusableCell(PriceTileErrorViewCell.Key) as PriceTileViewCell;
                if (priceTileCell == null)
                {
                    priceTileCell = PriceTileErrorViewCell.Create();
                }
                break;
            }

            return(priceTileCell);
        }
Beispiel #2
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            var cell = tableView.DequeueReusableCell(PriceTileTradeAffirmationViewCell.Key) as PriceTileTradeAffirmationViewCell;

            if (cell == null)
            {
                cell = PriceTileTradeAffirmationViewCell.Create();
            }

            var doneTrade = _tradeTilesModel [(int)indexPath.IndexAtPosition(1)];

            cell.UpdateFrom(doneTrade);

            return(cell);
        }