Example #1
0
            public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath)
            {
                Console.WriteLine(indexPath.ToString());
                int       rowIndex = indexPath.Row;
                ImageCell cell     = (ImageCell)collectionView.DequeueReusableCell(ImageCell.CELLID, indexPath);

                cell.ImageView.Image = collectionData[rowIndex];
                return(cell);
            }
 public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
 {
     /*
      * var Cell = (tableView.DataSource as MessageDataSource).CacheCell;
      * Console.WriteLine(Cell.TextViewMessage.Frame.ToString());
      * Cell.TextSizeAutoFit();
      * if (tableView.CellAt(indexPath) != null)
      * {
      *  Console.WriteLine("Hello...");
      * }
      */
     Console.WriteLine(indexPath.ToString() + " GetHeightForRow");
     return(200);
 }
Example #3
0
 public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
 {
     Debug.Write("indexPath = " + indexPath.ToString());
     return(base.GetCell(tableView, indexPath));
 }
Example #4
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            Console.WriteLine("********* {0}", indexPath.ToString());

            // Check for a reusable cell first, use that if it exists - before using nib
//			UITableViewCell cell = tableView.DequeueReusableCell("UITableViewCell");
//
//			if (cell == null)
//				// Create an instance of UITableViewCell, with default appearance
//				cell = new UITableViewCell(UITableViewCellStyle.Subtitle,"UITableViewCell");

            // Set the text on the cell with the description of the item
            // that is the nth index of items, where n = row this cell
            // will appear in on the tableView
            BNRItem p = BNRItemStore.allItems[indexPath.Row];

//			cell.TextLabel.Text = String.Format("Item: {0}, ${1}", p.itemName, p.valueInDollars);
//			cell.DetailTextLabel.Text = String.Format("SN: {0}, Added: {1}", p.serialNumber, p.dateCreated);
//			cell.BackgroundColor = UIColor.FromRGBA(1.0f, 1.0f, 1.0f, 0.5f);

            HomepwnerItemCell cell = tableView.DequeueReusableCell("HomepwnerItemCell") as HomepwnerItemCell;

            if (cell.nudgeValueCallback == null)
            {
                cell.nudgeValueCallback = nudgeItemValue;
                cell.showImageCallback  = showImageAtIndexPath;
            }

            // Configure the cell
            cell.nameLabel.Text         = p.itemName;
            cell.serialNumberLabel.Text = p.serialNumber;
            string currencySymbol = NSLocale.CurrentLocale.CurrencySymbol;

            cell.valueLabel.Text = String.Format("{0}{1}", currencySymbol, p.valueInDollars);
            if (p.valueInDollars < 0)
            {
                cell.valueLabel.TextColor = UIColor.Red;
            }
            else
            {
                cell.valueLabel.TextColor = UIColor.Black;
            }
            cell.stepper.MaximumValue = p.valueInDollars + 500;
            cell.stepper.MinimumValue = p.valueInDollars - 500;
            cell.stepper.Value        = p.valueInDollars;

            string thumbKey = p.imageKey + ".thumbnail";             // Changed from archiving method of saving for SQL method

            // If there is no image, we don;t need to do anything // For archiving method of saving
            UIImage img = BNRImageStore.imageForKey(thumbKey);             // Changed from archiving method of saving for SQL method

//			if (img == null) // For archiving method of saving
//				return; // For archiving method of saving

            cell.thumbnailView.Image = img;

//			cell.thumbnailView.Image = p.Thumbnail(); // Archiving method of saving

            cell.testIndexPathCallback = (ip) => {
                Console.WriteLine("Callback: {0}", ip.ToString());
            };
            cell.DoCallback(indexPath);

            return(cell);
        }