Beispiel #1
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            var cell = tableView.DequeueReusableCell("P") as PersonCell;

            if (cell == null)
            {
                cell = new PersonCell("P");
            }

            var person = GetPerson(indexPath);

            if (person != null)
            {
                cell.Person = person;

                UIImage image;
                if (images.TryGetValue(person.Id, out image))
                {
                    cell.ImageView.Image = image;
                }
                else
                {
                    if (!tableView.Dragging && !tableView.Decelerating && person.HasEmail)
                    {
                        StartImageDownload(tableView, indexPath, person);
                    }

                    cell.ImageView.Image = UIImage.FromBundle(PlaceholderImagePath);
                }
            }

            return(cell);
        }
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            var cell = tableView.DequeueReusableCell ("P") as PersonCell;

            if (cell == null)
                cell = new PersonCell ("P");

            var person = GetPerson (indexPath);
            if (person != null) {
                cell.Person = person;

                UIImage image;
                if (images.TryGetValue (person.Id, out image)) {
                    cell.ImageView.Image = image;
                } else {
                    if (!tableView.Dragging && !tableView.Decelerating && person.HasEmail)
                        StartImageDownload (tableView, indexPath, person);

                    cell.ImageView.Image = UIImage.FromBundle (PlaceholderImagePath);
                }
            }

            return cell;
        }