Exemple #1
0
        public override void TouchesBegan(Foundation.NSSet touches, UIEvent evt)
        {
            var touch = touches.AnyObject as UITouch;

            if (Magnifier == null)
            {
                Magnifier = new Magnifier();
            }

            if (Magnifier.ViewToMagnify == null)
            {
                Magnifier.ViewToMagnify = this;
            }

            var touchPoint = touch.LocationInView(this);

            Magnifier.TouchPoint = touchPoint;
            this.Superview.AddSubview(Magnifier);

            if (ShowOnTouch)
            {
                ShouldDisplay = true;
            }

            Magnifier.SetNeedsDisplay();
        }
Exemple #2
0
 public MagnifierView()
 {
     MagnifyingGlassShowDelay = DefaultShowDelay;
     Magnifier           = new Magnifier();
     Magnifier.Alpha     = 0.0f;
     this.ExclusiveTouch = false;
 }
		public MagnifierView ()
		{
			MagnifyingGlassShowDelay = DefaultShowDelay;
			Magnifier = new Magnifier ();
			Magnifier.Alpha = 0.0f;
			this.ExclusiveTouch = false;
		}
		public override void TouchesBegan (Foundation.NSSet touches, UIEvent evt)
		{
			var touch = touches.AnyObject as UITouch;

			if (Magnifier == null)
				Magnifier = new Magnifier ();

			if (Magnifier.ViewToMagnify == null)
				Magnifier.ViewToMagnify = this;

			var touchPoint = touch.LocationInView (this);

			Magnifier.TouchPoint = touchPoint;
			this.Superview.AddSubview (Magnifier);
			Magnifier.SetNeedsDisplay ();

			//if (Magnifier.Frame.Contains (touch.LocationInView (this)))
				System.Diagnostics.Debug.WriteLine ("touching");
		}
Exemple #5
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (this.Subviews.Any())
                {
                    for (int i = this.Subviews.Count() - 1; i >= 0; i--)
                    {
                        this.Subviews [i].RemoveFromSuperview();
                    }
                }

                if (Magnifier != null)
                {
                    Magnifier.RemoveFromSuperview();
                    Magnifier.Dispose();
                    Magnifier = null;
                }
            }

            base.Dispose(disposing);
        }
		protected override void Dispose (bool disposing)
		{
			if (disposing) {
				if (this.Subviews.Any ()) {
					for (int i = this.Subviews.Count() - 1; i >= 0; i--) {
						this.Subviews [i].RemoveFromSuperview ();
					}
				}

				if (Magnifier != null) {
					Magnifier.RemoveFromSuperview ();
					Magnifier.Dispose ();
					Magnifier = null;
				}
			}

			base.Dispose (disposing);
		}