示例#1
0
        void Control_Touch(object sender, TouchEventArgs e)
        {
            try
            {
                if (ImageTouch != null)
                {
                    switch (e.Event.Action)
                    {
                    case Android.Views.MotionEventActions.Pointer1Down:
                    case Android.Views.MotionEventActions.Down:
                        ImageTouch.RaiseOnTouch(true);
                        break;

                    case Android.Views.MotionEventActions.Up:
                    case Android.Views.MotionEventActions.Pointer1Up:
                    case Android.Views.MotionEventActions.Cancel:
                        ImageTouch.RaiseOnTouch(false);
                        break;
                    }
                }
            }
            catch (Exception e1)
            {
                ExceptionHandler.Catch(e1);
            }
        }
示例#2
0
        //void Control_Touch(object sender, TouchEventArgs e)
        //{
        //	if (ImageTouch != null)
        //	{
        //		switch (e.Event.Action)
        //		{
        //			case Android.Views.MotionEventActions.Pointer1Down:
        //			case Android.Views.MotionEventActions.Down:
        //				ImageTouch.RaiseOnTouch(true);
        //				break;
        //			case Android.Views.MotionEventActions.Up:
        //			case Android.Views.MotionEventActions.Pointer1Up:
        //			case Android.Views.MotionEventActions.Cancel:
        //				ImageTouch.RaiseOnTouch(false);
        //				break;
        //		}
        //	}
        //}

        public override void TouchesEnded(Foundation.NSSet touches, UIKit.UIEvent evt)
        {
            base.TouchesEnded(touches, evt);
            if (ImageTouch != null)
            {
                ImageTouch.RaiseOnTouch(false);
            }
        }