private void OnWidgetMouseDown(object sender, WidgetMouseEventArgs e) { if (Widget.IsEnabled && e.Buttons == MouseButtons.Left) { _lastLocation = e.Location; IsMoving = true; } }
private void OnWidgetMouseMove(object sender, WidgetMouseEventArgs e) { if (IsMoving) { var offsetX = e.Location.X - _lastLocation.X; var offsetY = e.Location.Y - _lastLocation.Y; if (offsetX != 0 || offsetY != 0) { var offset = Move(new Point(offsetX, offsetY)); _lastLocation.Offset(offset); OnRegionMoved(RegionChangedEventArgs.ForLocationChanged); } } }
private void OnWidgetMouseUp(object sender, WidgetMouseEventArgs e) { IsMoving = false; }