protected override void OnEnable() { CreateGustures(); if (_ScaleDetector != null) { _ScaleDetector.IsEnabled = true; } if (_DragDetector != null) { _DragDetector.IsEnabled = SelectedElement != null; } if (_TapDetector != null) { _TapDetector.IsEnabled = true; } if (Elements != null) { foreach (var e in Elements) { if (e != null) { e.enabled = false; } } } if (SelectedElement == null && Elements != null) { SelectedElement = Elements[0]; } }
protected virtual void OnDisable() { SelectedElement = null; if (_ScaleDetector != null) { _ScaleDetector.IsEnabled = false; } if (_DragDetector != null) { _DragDetector.IsEnabled = false; } if (_TapDetector != null) { _TapDetector.IsEnabled = false; } if (Elements != null) { foreach (var e in Elements) { if (e != null) { e.enabled = true; } } } }
void JoyElementResizer_Tap(object sender, TapGestureEventArgs args) { foreach (var item in Elements) { if (item != null) { if (item.RenderArea.Contains(args.Positions[0])) { SelectedElement = item; break; } } } }