//Modify.Choijh.2021.05.27.Insert code Image fit used Mouse Right btn.Start... private void Border_PreviewMouseRightButtonDown(object sender, MouseEventArgs e) { var pos = e.GetPosition(sender as IInputElement); _initPos = pos; _offset = new Point(_viewModel.ZoomService.TranslateX, _viewModel.ZoomService.TranslateY); _dragMode = EDragMode.Panning; }
private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { var pos = e.GetPosition(sender as IInputElement); _dragMode = EDragMode.Calc; if (_viewModel.ZoomService.Scale == 0) { return; } _viewModel.StartPt = new Point( (pos.X - _viewModel.ZoomService.TranslateX) / _viewModel.ZoomService.Scale, (pos.Y - _viewModel.ZoomService.TranslateY) / _viewModel.ZoomService.Scale); _viewModel.EndPt = _viewModel.StartPt; _viewModel.IsCalcMode = true; }
private void Border_MouseLeave(object sender, MouseEventArgs e) { _dragMode = EDragMode.None; _viewModel.IsCalcMode = false; }
private void Border_PreviewMouseUp(object sender, MouseButtonEventArgs e) { _dragMode = EDragMode.None; _viewModel.IsCalcMode = false; }