public void applyGravity(object sender, EventArgs e)
        {
            animator = new UIDynamicAnimator (chart.PlotView);

            TKChartVisualPoint[] points = chart.VisualPointsForSeries (chart.Series [0]);

            for (int i=0; i<points.Length; i++) {
                TKChartVisualPoint point = points [i];
                CGPoint center = originalValues [i];
                if (point.Animator != null) {
                    point.Animator.RemoveAllBehaviors();
                    point.Animator = null;
                }
                point.Center = center;
            }

            UICollisionBehavior collision = new UICollisionBehavior (points);
            collision.TranslatesReferenceBoundsIntoBoundary = true;

            UIGravityBehavior gravity = new UIGravityBehavior (points);
            gravity.GravityDirection = new CGVector (0.0f, 2.0f);

            UIDynamicItemBehavior dynamic = new UIDynamicItemBehavior (points);
            dynamic.Elasticity = 0.5f;

            animator.AddBehavior(dynamic);
            animator.AddBehavior(gravity);
            animator.AddBehavior(collision);
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			var gravityBehavior = new UIGravityBehavior (square);

			var collisionBehavior = new UICollisionBehavior (square) {
				TranslatesReferenceBoundsIntoBoundary = true
			};
			collisionBehavior.BeganBoundaryContact += (sender, e) => {
				((UIView)e.DynamicItem).BackgroundColor = UIColor.LightGray;
			};
			collisionBehavior.EndedBoundaryContact += (sender, e) => {
				((UIView)e.DynamicItem).BackgroundColor = UIColor.Gray;
			};

			var squareCenterPoint = new CGPoint (square.Center.X, square.Center.Y - 100);

			var attachmentBehavior = new UIAttachmentBehavior (square, squareCenterPoint) {
				Frequency = 1.0f,
				Damping = 0.1f
			};

			redSquare.Center = attachmentBehavior.AnchorPoint;
			blueSquare.Center = new CGPoint (50.0f, 50.0f);

			Animator = new UIDynamicAnimator (View);
			Animator.AddBehaviors (attachmentBehavior, gravityBehavior, collisionBehavior);

			View.AddGestureRecognizer (new UIPanGestureRecognizer ((gesture) => {
				attachmentBehavior.AnchorPoint = gesture.LocationInView (View);
				redSquare.Center = attachmentBehavior.AnchorPoint;
			}));
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			/*
     			We want to show collisions between views and boundaries with different 
     			elasticities, we thus associate the two views to gravity and collision 
     			behaviors. We will only change the restitution parameter for one of 
     			these views.
     		*/
			var gravityBehavior = new UIGravityBehavior (square1, square2);

			var collisionBehavior = new UICollisionBehavior (square1, square2) {
				TranslatesReferenceBoundsIntoBoundary = true
			};
			collisionBehavior.BeganBoundaryContact += (sender, e) => {
				((UIView)e.DynamicItem).BackgroundColor = UIColor.LightGray;
			};
			collisionBehavior.EndedBoundaryContact += (sender, e) => {
				((UIView)e.DynamicItem).BackgroundColor = UIColor.Gray;
			};

			var propertiesBehavior = new UIDynamicItemBehavior (square2) {
				Elasticity = 0.5f
			};
	
			Animator = new UIDynamicAnimator (View);
			Animator.AddBehaviors (gravityBehavior, collisionBehavior, propertiesBehavior);
		}
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            /*
             * We want to show collisions between views and boundaries with different
             * elasticities, we thus associate the two views to gravity and collision
             * behaviors. We will only change the restitution parameter for one of
             * these views.
             */
            var gravityBehavior = new UIGravityBehavior(square1, square2);

            var collisionBehavior = new UICollisionBehavior(square1, square2)
            {
                TranslatesReferenceBoundsIntoBoundary = true
            };

            collisionBehavior.BeganBoundaryContact += (sender, e) => {
                ((UIView)e.DynamicItem).BackgroundColor = UIColor.LightGray;
            };
            collisionBehavior.EndedBoundaryContact += (sender, e) => {
                ((UIView)e.DynamicItem).BackgroundColor = UIColor.Gray;
            };

            var propertiesBehavior = new UIDynamicItemBehavior(square2)
            {
                Elasticity = 0.5f
            };

            Animator = new UIDynamicAnimator(View);
            Animator.AddBehaviors(gravityBehavior, collisionBehavior, propertiesBehavior);
        }
        protected void DynamicAnimatorDidPause(UIDynamicAnimator animator)
        {
            this.Animator.RemoveAllBehaviors();

            _collision = null;
            _topView   = null;
            _push      = null;
            _gravity   = null;
            _composite = null;
            _animator  = null;

            this.SlidingViewController.TopViewController.View.UserInteractionEnabled = true;

            UIViewController topController = this.SlidingViewController.GetViewControllerForKey(ECSlidingViewController.ECTransitionContextTopViewControllerKey);

            if ((_panningRight && _positiveLeftToRight) || (!_panningRight && !_positiveLeftToRight))
            {
                topController.View.Frame = this.SlidingViewController.GetFinalFrameForViewController(topController);
                this.SlidingViewController.FinishInteractiveTransition();
            }
            else if ((_panningRight && !_positiveLeftToRight) || (!_panningRight && _positiveLeftToRight))
            {
                topController.View.Frame = this.SlidingViewController.GetInitialFrameForViewController(topController);
                this.SlidingViewController.CancelInteractiveTransition();
            }

            this.SlidingViewController.CompleteTransition(true);
        }
Example #6
0
        public void applyGravity(object sender, EventArgs e)
        {
            animator = new UIDynamicAnimator(chart.PlotView);

            TKChartVisualPoint[] points = chart.VisualPointsForSeries(chart.Series [0]);

            for (int i = 0; i < points.Length; i++)
            {
                TKChartVisualPoint point  = points [i];
                CGPoint            center = originalValues [i];
                if (point.Animator != null)
                {
                    point.Animator.RemoveAllBehaviors();
                    point.Animator = null;
                }
                point.Center = center;
            }

            UICollisionBehavior collision = new UICollisionBehavior(points);

            collision.TranslatesReferenceBoundsIntoBoundary = true;

            UIGravityBehavior gravity = new UIGravityBehavior(points);

            gravity.GravityDirection = new CGVector(0.0f, 2.0f);

            UIDynamicItemBehavior dynamic = new UIDynamicItemBehavior(points);

            dynamic.Elasticity = 0.5f;

            animator.AddBehavior(dynamic);
            animator.AddBehavior(gravity);
            animator.AddBehavior(collision);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var Gravedad = new UIGravityBehavior(Imagen1);//Se agrega gravedad a uno de los objectos.
            var Colision = new UICollisionBehavior(Imagen2)
            {
                TranslatesReferenceBoundsIntoBoundary = true
            };

            var PuntoCentral = new CGPoint(Imagen1.Center.X,
                                           Imagen1.Center.Y -
                                           100);

            var Anclaje = new UIAttachmentBehavior(Imagen1, PuntoCentral) //Se conecta la imagen al punto centra
            {
                Frequency = 1.0f,
                Damping   = 0.1f //forma en la que esta haciendo el rebote.
            };

            Imagen2.Center = Anclaje.AnchorPoint;
            Imagen2.Center = new CGPoint(50.0f, 50.0f);
            Animador       = new UIDynamicAnimator(View);
            Animador.AddBehaviors(Anclaje, Gravedad, Colision);
            View.AddGestureRecognizer(new UIPanGestureRecognizer((gesto) =>
            {
                Anclaje.AnchorPoint = gesto.LocationInView(View);
                Imagen2.Center      = Anclaje.AnchorPoint;
            }));
        }
Example #8
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            using (image = UIImage.FromFile("monkeys.jpg")) {
                imageView = new UIImageView(new CGRect(new CGPoint(View.Center.X - image.Size.Width / 2, 0), image.Size))
                {
                    Image = image
                };

                View.AddSubview(imageView);

                // 1. create the dynamic animator
                dynAnimator = new UIDynamicAnimator(this.View);

                // 2. create behavior(s)
                var dynItems  = new IUIDynamicItem[] { imageView };
                var gravity   = new UIGravityBehavior(dynItems);
                var collision = new UICollisionBehavior(dynItems)
                {
                    TranslatesReferenceBoundsIntoBoundary = true
                };
                var dynBehavior = new UIDynamicItemBehavior(dynItems)
                {
                    Elasticity = 0.7f
                };

                // 3. add behaviors(s) to the dynamic animator
                dynAnimator.AddBehavior(gravity);
                dynAnimator.AddBehavior(collision);
                dynAnimator.AddBehavior(dynBehavior);
            }
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			using (image = UIImage.FromFile ("monkeys.jpg")) {

				imageView = new UIImageView (new CGRect (new CGPoint (View.Center.X - image.Size.Width / 2, 0), image.Size)) {
					Image =  image
				};

				View.AddSubview (imageView);

				// 1. create the dynamic animator
				dynAnimator = new UIDynamicAnimator (this.View);

				// 2. create behavior(s)
				var dynItems = new IUIDynamicItem[] { imageView };
				var gravity = new UIGravityBehavior (dynItems);
				var collision = new UICollisionBehavior (dynItems) {
					TranslatesReferenceBoundsIntoBoundary = true
				};
				var dynBehavior = new UIDynamicItemBehavior (dynItems) {
					Elasticity = 0.7f
				};

				// 3. add behaviors(s) to the dynamic animator
				dynAnimator.AddBehavior (gravity);
				dynAnimator.AddBehavior (collision);
				dynAnimator.AddBehavior (dynBehavior);
			}
		}
        public void applyGravity()
        {
            if (firstTime)
            {
                firstTime = false;

                TKChartVisualPoint[] points1 = chart.VisualPointsForSeries(chart.Series [0]);
                originalValues = new List <CGPoint> ();
                foreach (TKChartVisualPoint p in points1)
                {
                    originalValues.Add(p.CGPoint);
                }
                TKChartVisualPoint point1 = points1 [4];
                originalLocation = point1.Center;
            }
            // >> chart-anim-gravity-cs
            animator = new UIDynamicAnimator(chart.PlotView);
            TKChartVisualPoint[] points = chart.VisualPointsForSeries(chart.Series [0]);
            TKChartVisualPoint   point  = points [4];

            for (int i = 0; i < originalValues.Count; i++)
            {
                TKChartVisualPoint pt = points [i];
                if (pt.Animator != null)
                {
                    pt.Animator.RemoveAllBehaviors();
                    pt.Animator = null;
                }
                pt.Center = ((CGPoint)originalValues[i]);
            }

            point.Center = new CGPoint(originalLocation.X, 0);

            UICollisionBehavior collision = new UICollisionBehavior(points);

            collision.TranslatesReferenceBoundsIntoBoundary = true;

            UIGravityBehavior gravity = new UIGravityBehavior(points);

            gravity.GravityDirection = new CGVector(0.0f, 2.0f);

            UIDynamicItemBehavior dynamic = new UIDynamicItemBehavior(points);

            dynamic.Elasticity = 0.5f;

            animator.AddBehavior(dynamic);
            animator.AddBehavior(gravity);
            animator.AddBehavior(collision);
            // << chart-anim-gravity-cs
        }
Example #11
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            //agrega el UIVIew para aplicar el comportamiento de la animacion
            var gravityBehavior = new UIGravityBehavior(square);

            var gravityBehavior2 = new UIGravityBehavior(Balon);

            //limite sobre la collision
            var collisionBehavior = new UICollisionBehavior(square)
            {
                TranslatesReferenceBoundsIntoBoundary = true
            };


            var collisionBehavior2 = new UICollisionBehavior(Balon)
            {
                TranslatesReferenceBoundsIntoBoundary = true
            };


            //cuando tenga contacto sos los metodo de comenzar y finalizar
            collisionBehavior.BeganBoundaryContact += (sender, e) => {
                ((UIView)e.DynamicItem).BackgroundColor = UIColor.LightGray;
            };
            collisionBehavior.EndedBoundaryContact += (sender, e) => {
                ((UIView)e.DynamicItem).BackgroundColor = UIColor.Gray;
            };

            // Another style of creating the UIDynamicAnimator
            Animator = new UIDynamicAnimator(View)
            {
                gravityBehavior, collisionBehavior
            };

            Animator = new UIDynamicAnimator(View)
            {
                gravityBehavior2, collisionBehavior2
            };

            UIDynamicItemBehavior ball = new UIDynamicItemBehavior(Balon);

            ball.Elasticity = 0.75f;
            Animator.Add(ball);
        }
Example #12
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var Gravedad = new UIGravityBehavior(Imagen1, Imagen2);//Se agrega gravedad a uno de los objectos.
            var Colision = new UICollisionBehavior(Imagen1, Imagen2)
            {
                TranslatesReferenceBoundsIntoBoundary = true
            };

            var Rebote = new UIDynamicItemBehavior(Imagen2)
            {
                Elasticity = 1f
            };

            Animador = new UIDynamicAnimator(View);
            Animador.AddBehaviors(Gravedad, Colision, Rebote);
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
		
			var gravityBehavior = new UIGravityBehavior (square);

			var collisionBehavior = new UICollisionBehavior (square) {
				TranslatesReferenceBoundsIntoBoundary = true
			};
			collisionBehavior.BeganBoundaryContact += (sender, e) => {
				((UIView)e.DynamicItem).BackgroundColor = UIColor.LightGray;
			};
			collisionBehavior.EndedBoundaryContact += (sender, e) => {
				((UIView)e.DynamicItem).BackgroundColor = UIColor.Gray;
			};

			// Another style of creating the UIDynamicAnimator
			Animator = new UIDynamicAnimator (View) { gravityBehavior, collisionBehavior };
		}
Example #14
0
        private void reset()
        {
            foreach (var subview in Subviews)
            {
                subview.RemoveFromSuperview();
            }

            motionManager?.Dispose();
            gravity?.Dispose();
            spiderAnimator?.Dispose();
            spiderView?.Dispose();

            spiderAnimator = null;
            motionManager  = null;
            gravity        = null;
            spiderView     = null;

            IsVisible = false;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.BackgroundColor = UIColor.White;
            animator = new UIDynamicAnimator(View);
            gravity = new UIGravityBehavior();
            animator.AddBehavior(gravity);

            // Tap to add new item.
            View.AddGestureRecognizer(new UITapGestureRecognizer((gesture) => {
                PointF tapLocation = gesture.LocationInView(View);
                var item = new UIView(new RectangleF(PointF.Empty, sizeInitial)) {
                    BackgroundColor = ColorHelpers.GetRandomColor(),
                    Center = tapLocation,
                };
                items.Enqueue(item);
                View.Add(item);
                gravity.AddItem(item);

                // Clean up old items so things don't get too leaky.
                if (items.Count > 20) {
                    var oldItem = items.Dequeue();
                    oldItem.RemoveFromSuperview();
                    gravity.RemoveItem(oldItem);
                    oldItem.Dispose();
                }
            }));

            // Swipe to change gravity direction.
            View.AddGestureRecognizer(new UISwipeGestureRecognizer((gesture) => {
                gravity.GravityDirection = new CGVector(1, 0);
            }) { Direction = UISwipeGestureRecognizerDirection.Right, });
            View.AddGestureRecognizer(new UISwipeGestureRecognizer((gesture) => {
                gravity.GravityDirection = new CGVector(-1, 0);
            }) { Direction = UISwipeGestureRecognizerDirection.Left, });
            View.AddGestureRecognizer(new UISwipeGestureRecognizer((gesture) => {
                gravity.GravityDirection = new CGVector(0, -1);
            }) { Direction = UISwipeGestureRecognizerDirection.Up, });
            View.AddGestureRecognizer(new UISwipeGestureRecognizer((gesture) => {
                gravity.GravityDirection = new CGVector(0, 1);
            }) { Direction = UISwipeGestureRecognizerDirection.Down, });
        }
Example #16
0
		public void applyGravity()
		{
			if (firstTime) {
				firstTime = false;

				TKChartVisualPoint[] points1 = chart.VisualPointsForSeries (chart.Series [0]);
				originalValues = new List<CGPoint> ();
				foreach (TKChartVisualPoint p in points1) {
					originalValues.Add (p.CGPoint);
				}
				TKChartVisualPoint point1 = points1 [4];
				originalLocation = point1.Center;
			}

			animator = new UIDynamicAnimator (chart.PlotView);
			TKChartVisualPoint[] points = chart.VisualPointsForSeries (chart.Series [0]);
			TKChartVisualPoint point = points [4];

			for (int i=0; i<originalValues.Count; i++) {
				TKChartVisualPoint pt = points [i];
				if (pt.Animator != null) {
					pt.Animator.RemoveAllBehaviors();
					pt.Animator = null;
				}
				pt.Center = ((CGPoint)originalValues[i]);
			}

			point.Center = new CGPoint (originalLocation.X, 0);

			UICollisionBehavior collision = new UICollisionBehavior (points);
			collision.TranslatesReferenceBoundsIntoBoundary = true;

			UIGravityBehavior gravity = new UIGravityBehavior (points);
			gravity.GravityDirection = new CGVector (0.0f, 2.0f);

			UIDynamicItemBehavior dynamic = new UIDynamicItemBehavior (points);
			dynamic.Elasticity = 0.5f;

			animator.AddBehavior(dynamic);
			animator.AddBehavior(gravity);
			animator.AddBehavior(collision);
		}
Example #17
0
        private void preparePhysics()
        {
            spiderView.Center            = new CGPoint(Center.X, -height - spiderImage.Size.Height);
            spiderView.Layer.AnchorPoint = new CGPoint(0.5, 0);

            spiderAnimator = new UIDynamicAnimator(this);

            var spider = new UIDynamicItemBehavior(spiderView);

            spider.Action     = () => SetNeedsDisplay();
            spider.Resistance = spiderResistance;
            spiderAnimator.AddBehavior(spider);

            links = createRope();

            gravity = new UIGravityBehavior(links);
            spiderAnimator.AddBehavior(gravity);

            motionManager?.Dispose();
            motionManager = new CMMotionManager();
            motionManager.StartAccelerometerUpdates(NSOperationQueue.CurrentQueue, processAccelerometerData);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.BackgroundColor = UIColor.White;
            animator = new UIDynamicAnimator(View);

            item = new UIView(new RectangleF(new PointF(50f, 0f), new SizeF(50f, 50f))) {
                BackgroundColor = UIColor.Blue,
            };
            View.Add(item);
            UIGravityBehavior gravity = new UIGravityBehavior(item);
            animator.AddBehavior(gravity);

            // Tap to bring item back.
            View.AddGestureRecognizer(new UITapGestureRecognizer((gesture) => {
                PointF tapLocation = gesture.LocationInView(View);
                // Must remove from gravity first or it will only flash to location
                // then continue animated from where it was.
                gravity.RemoveItem(item);
                item.Center = tapLocation;
                gravity.AddItem(item);
            }));
        }
Example #19
0
        private void preparePhysics()
        {
            spiderRadius = Math.Sqrt(Math.Pow(spiderImage.Size.Width / 2, 2) + Math.Pow(spiderImage.Size.Height / 2, 2));
            double height = (UIScreen.MainScreen.ApplicationFrame.Size.Width / 2) - 1.5 * spiderRadius;

            spiderAnimator = new UIDynamicAnimator(this);

            var spider = new UIDynamicItemBehavior(spiderView);

            spider.Action         = () => SetNeedsDisplay();
            spider.Resistance     = spiderResistance;
            spider.AllowsRotation = true;
            spiderAnimator.AddBehavior(spider);

            links = createRope(height);

            gravity = new UIGravityBehavior(links);
            spiderAnimator.AddBehavior(gravity);

            motionManager?.Dispose();
            motionManager = new CMMotionManager();
            motionManager.StartAccelerometerUpdates(NSOperationQueue.CurrentQueue, processAccelerometerData);
        }
Example #20
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var gravityBehavior = new UIGravityBehavior(square);

            var collisionBehavior = new UICollisionBehavior(square)
            {
                TranslatesReferenceBoundsIntoBoundary = true
            };

            collisionBehavior.BeganBoundaryContact += (sender, e) => {
                ((UIView)e.DynamicItem).BackgroundColor = UIColor.LightGray;
            };
            collisionBehavior.EndedBoundaryContact += (sender, e) => {
                ((UIView)e.DynamicItem).BackgroundColor = UIColor.Gray;
            };

            var squareCenterPoint = new PointF(square.Center.X, square.Center.Y - 100);

            var attachmentBehavior = new UIAttachmentBehavior(square, squareCenterPoint)
            {
                Frequency = 1.0f,
                Damping   = 0.1f
            };

            redSquare.Center  = attachmentBehavior.AnchorPoint;
            blueSquare.Center = new PointF(50.0f, 50.0f);

            Animator = new UIDynamicAnimator(View);
            Animator.AddBehaviors(attachmentBehavior, gravityBehavior, collisionBehavior);

            View.AddGestureRecognizer(new UIPanGestureRecognizer((gesture) => {
                attachmentBehavior.AnchorPoint = gesture.LocationInView(View);
                redSquare.Center = attachmentBehavior.AnchorPoint;
            }));
        }
Example #21
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var gravityBehavior = new UIGravityBehavior(square);

            var collisionBehavior = new UICollisionBehavior(square)
            {
                TranslatesReferenceBoundsIntoBoundary = true
            };

            collisionBehavior.BeganBoundaryContact += (sender, e) => {
                ((UIView)e.DynamicItem).BackgroundColor = UIColor.LightGray;
            };
            collisionBehavior.EndedBoundaryContact += (sender, e) => {
                ((UIView)e.DynamicItem).BackgroundColor = UIColor.Gray;
            };

            // Another style of creating the UIDynamicAnimator
            Animator = new UIDynamicAnimator(View)
            {
                gravityBehavior, collisionBehavior
            };
        }
        protected void DynamicAnimatorDidPause(UIDynamicAnimator animator)
        {
            this.Animator.RemoveAllBehaviors();

            _collision = null;
            _topView   = null;
            _push      = null;
            _gravity   = null;
            _composite = null;
            _animator  = null;

            this.SlidingViewController.TopViewController.View.UserInteractionEnabled = true;

            UIViewController topController = this.SlidingViewController.GetViewControllerForKey(ECSlidingViewController.ECTransitionContextTopViewControllerKey);
            if ((_panningRight && _positiveLeftToRight) || (!_panningRight && !_positiveLeftToRight))
            {
                topController.View.Frame = this.SlidingViewController.GetFinalFrameForViewController(topController);
                this.SlidingViewController.FinishInteractiveTransition();
            }
            else if ((_panningRight && !_positiveLeftToRight) || (!_panningRight && _positiveLeftToRight))
            {
                topController.View.Frame = this.SlidingViewController.GetInitialFrameForViewController(topController);
                this.SlidingViewController.CancelInteractiveTransition();
            }

            this.SlidingViewController.CompleteTransition(true);
        }
Example #23
0
        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();
            var verifica = new LAContext();
            var autoriza = await verifica.EvaluatePolicyAsync
                               (LAPolicy.DeviceOwnerAuthenticationWithBiometrics,
                               "Autenticación FaceID");

            if (autoriza.Item1)
            {
                var voz = new AVSpeechUtterance("Está usted autorizado en la Aplicación, sea Bienvenido");
                voz.Voice = AVSpeechSynthesisVoice.FromLanguage("es-MX");
                habla.SpeakUtterance(voz);
                lblEstatus.Text = "Autorizado";
            }
            else
            {
                lblEstatus.Text = "No Autorizado";

                var Gravedad = new UIGravityBehavior(Imagen, btnConfirmar, btnGuardar, lblEstatus);
                var Colision = new UICollisionBehavior(Imagen, btnConfirmar, btnGuardar, lblEstatus)
                {
                    TranslatesReferenceBoundsIntoBoundary = false
                };
                var Rebote = new UIDynamicItemBehavior(btnConfirmar)
                {
                    Elasticity = 1f
                };
                Animador = new UIDynamicAnimator(View);
                Animador.AddBehaviors(Gravedad, Colision, Rebote);
                System.Threading.Thread.CurrentThread.Abort();
            }
            var Firma = new SignaturePadView(View.Frame)
            {
                StrokeWidth     = 3f,
                StrokeColor     = UIColor.Black,
                BackgroundColor = UIColor.White,
            };

            Firma.Frame                     = new CGRect(10, 500, 350, 200);
            Firma.Layer.BorderWidth         = 1f;
            Firma.SignaturePrompt.TextColor = UIColor.Blue;
            Firma.Caption.TextColor         = UIColor.White;
            Firma.Caption.Text              = "Firmar en esta zona";
            View.AddSubview(Firma);

            btnConfirmar.TouchUpInside += delegate
            {
                Imagen.Image = Firma.GetImage();
            };
            btnGuardar.TouchUpInside += delegate
            {
                var imagenfirma = Firma.GetImage();
                try
                {
                    imagenfirma.SaveToPhotosAlbum(delegate
                                                  (UIImage imagen, NSError error)
                                                  { });
                    lblEstatus.Text = "Guardado en biblioteca";
                }
                catch (Exception ex)
                {
                    lblEstatus.Text = ex.Message;
                }
            };
        }