/// <summary>
        /// Updates the cell.
        /// </summary>
        /// <param name="collectionView">Collection view.</param>
        /// <param name="indexpath">Indexpath.</param>
        /// <param name="image">Image.</param>
        /// <param name="itemsList">Items list.</param>
        /// <param name="controller">Controller.</param>
        public void UpdateCell(UICollectionView collectionView, NSIndexPath indexpath, UIImage image, List <UIImage> itemsList, UIViewController controller)
        {
            ImageView.RemoveGestureRecognizer(gr);
            ImageView.RemoveGestureRecognizer(tb);

            ImageView.AddGestureRecognizer(gr);
            ImageView.AddGestureRecognizer(tb);
            ImageView.UserInteractionEnabled = true;


            if (controller.GetType() == typeof(UICameraController))
            {
                this.cameraController = controller as UICameraController;
            }
            else if (controller.GetType() == typeof(InspectionViewController))
            {
                this.inspectionController = controller as InspectionViewController;
            }

            this.itemsList  = itemsList;
            count           = (itemsList.Count) - 1;
            ImageView.Image = image;
            this.indexpath  = indexpath;

            this.CollectionView = collectionView;
        }
Exemple #2
0
        void BtnTakePic_TouchUpInside(object sender, EventArgs e)
        {
            UICameraController cameraController = parentController.Storyboard.InstantiateViewController("UICameraController") as UICameraController;

            cameraController.ClearCamearaView();
            cameraController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            cameraController.picture = this.UpdateCollectionImageView;
            if (cameraController.MediaLst != null)
            {
                cameraController.MediaLst.Clear();
            }

            if (MediaLst != null && MediaLst.Count > 0)
            {
                MediaLst.Clear();
            }

            foreach (UIImage image in imagesList)
            {
                UIImageView imageView = new UIImageView();
                imageView.Image = image;
                MediaLst.Add(imageView);
            }
            cameraController.MediaLst = MediaLst;
            IsPunchValueChanged       = true;
            parentController.PresentViewController(cameraController, false, null);
        }
Exemple #3
0
        /// <summary>
        /// Guided photo take picture button touch up inside.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        void guidedPhotoTkPicBtn_TouchUpInside(object sender, EventArgs e)
        {
            try {
                ResetTheCameraImageView();
                if (parentController != null)
                {
                    UICameraController cameraController = parentController.Storyboard.InstantiateViewController("UICameraController") as UICameraController;
                    cameraController.ClearCamearaView();
                    cameraController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
                    cameraController.picture = this.UpdateCollectionImageView;
                    if (cameraController.MediaLst != null)
                    {
                        foreach (var view in cameraController.MediaLst)
                        {
                            view.RemoveFromSuperview();
                        }
                        cameraController.MediaLst.Clear();
                    }
                    if (cameraController.imagesList != null)
                    {
                        cameraController.imagesList.Clear();
                    }

                    if (this.ImageLst == null)
                    {
                        this.ImageLst = new List <UIImage> ();
                    }

                    List <UIImageView> MediaLst = new List <UIImageView> ();
                    if (this.ImageLst.Count > 0)
                    {
                        foreach (UIImage image in this.ImageLst)
                        {
                            UIImageView imageView = new UIImageView();
                            imageView.Image = image;
                            MediaLst.Add(imageView);
                        }
                    }
                    cameraController.MediaLst = MediaLst;
                    parentController.PresentViewController(cameraController, false, null);
                }
            } catch (Exception ex) {
                Debug.WriteLine("Exception Occured in BtnTakePic_TouchUpInside method due to " + ex.Message);
            }
        }
Exemple #4
0
 void takePictureBtn_TouchUpInside(object sender, EventArgs e)
 {
     try {
         ResetTheCameraImageView();
         UICameraController cameraController = parentController.Storyboard.InstantiateViewController("UICameraController") as UICameraController;
         cameraController.ClearCamearaView();
         cameraController.ModalPresentationStyle = UIModalPresentationStyle.OverCurrentContext;
         cameraController.picture = this.UpdateCollectionImageView;
         if (cameraController.MediaLst != null)
         {
             cameraController.MediaLst.Clear();
         }
         cameraController.MediaLst = ImageLst;
         parentController.PresentViewController(cameraController, false, null);
     } catch (Exception ex) {
         Debug.WriteLine("Exception Occured in BtnTakePic_TouchUpInside method due to " + ex.Message);
     }
 }