public override void TouchesEnded(NSSet touches, UIEvent evt) { if (!isBeingModified) { EventArgs e = new EventArgs(); base.TouchesBegan(touches, evt); UITouch touch = touches.AnyObject as UITouch; CGPoint p = touch.LocationInView(touch.View); for (int i = 0; i < curveArray.Length; i++) { if (viewArray[i].Frame.Contains(touch.LocationInView(View))) { if (stopwatch.ElapsedMilliseconds > 200) { curveArray[currentSelection].InvertColors = false; currentSelection = i; curveArray[currentSelection].InvertColors = true; ButtonHeld?.Invoke(this, e); //ButtonPressed?.Invoke(this, e); } else { // the touch event happened inside the UIView curveArray[currentSelection].InvertColors = false; currentSelection = i; curveArray[currentSelection].InvertColors = true; ButtonPressed?.Invoke(this, e); } } } } }
protected virtual void OnButtonHeld(object sneder, NativeMenuItemButtonEventArgs e) { ButtonHeld?.Invoke(sneder, e); }