public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath) { var cell = (UserCellAttribute2)collectionView.DequeueReusableCell(UserCellAttribute2.CellID, indexPath); ImageCellAttribute2 row = Cells[indexPath.Row]; cell.UpdateRow(row, ImageViewSize); return(cell); }
public override void ItemUnhighlighted(UICollectionView collectionView, NSIndexPath indexPath) { //Get the Selected Image var cell = (UserCellAttribute2)collectionView.CellForItem(indexPath); ImageCellAttribute2 Clicked = Cells[indexPath.Row]; if (ImageClickedToController != null && isAttributesTab) { ImageClickedToController(Clicked.ImgOBJ); } }
public void clearSelectedImages(UICollectionView collectionView) { for (int i = 0; i < SelectedImagesToImageStack.Count; i++) { var cell = (UserCellAttribute2)collectionView.CellForItem(pathsForSelectedItems[i]); ImageCellAttribute2 Clicked = Cells[pathsForSelectedItems[i].Row]; cell.ImageView.Alpha = 1.0f; Clicked.isSelected = false; //remove the object from the list //SelectedImagesToImageStack.Remove(Clicked.ImgOBJ); } SelectedImagesToImageStack.Clear(); pathsForSelectedItems.Clear(); }
public override void ItemHighlighted(UICollectionView collectionView, NSIndexPath indexPath) { var cell = (UserCellAttribute2)collectionView.CellForItem(indexPath); ImageCellAttribute2 Clicked = Cells[indexPath.Row]; if (isAttributesTab) { //unlick the previous image if (prevImageSelected != null && prevImageSelected != indexPath && isAttributesTab) { var cellPrev = (UserCellAttribute2)collectionView.CellForItem(prevImageSelected); Cells[prevImageSelected.Row].isSelected = false; var pCell = (UserCellAttribute2)collectionView.CellForItem(prevImageSelected); pCell.ImageView.Alpha = 1.0f; } cell.ImageView.Alpha = 0.5f; prevImageSelected = indexPath; } else { if (Clicked.isSelected) { cell.ImageView.Alpha = 1.0f; Clicked.isSelected = false; //remove the object from the list pathsForSelectedItems.Remove(indexPath); SelectedImagesToImageStack.Remove(Clicked.ImgOBJ); } else { cell.ImageView.Alpha = 0.5f; Clicked.isSelected = true; //add the image object to the list pathsForSelectedItems.Add(indexPath); SelectedImagesToImageStack.Add(Clicked.ImgOBJ); } } }
public void UpdateRow(ImageCellAttribute2 element, SizeF imageViewSize) { ImageView.Image = Utilities.GetUIImageFromFileNameThumbnail(element.ImgOBJ.FileName.ToString()); ImageView.Frame = new RectangleF(0, 0, imageViewSize.Width, imageViewSize.Height); }