public CanvasObjectMover([NotNull] FrameworkElement element, [NotNull] DragBehavior behavior) : base(element, behavior) { _StartLeft = Canvas.GetLeft(element); _StartRight = Canvas.GetRight(element); _StartTop = Canvas.GetTop(element); _StartBottom = Canvas.GetBottom(element); }
protected ObjectMover([NotNull] UIElement element, [NotNull] DragBehavior behavior) { _MovingElement = element; _Behavior = behavior; _ParentElement = element.FindLogicalParent <IInputElement>() ?? throw new InvalidOperationException("Не найден родительский элемент"); _StartPos = Mouse.GetPosition(_ParentElement); Mouse.Capture(element, CaptureMode.SubTree); element.MouseMove += OnMouseMove; element.MouseLeftButtonUp += OnLeftMouseUp; }
public ThicknessObjectMover([NotNull] FrameworkElement element, [NotNull] DragBehavior behavior) : base(element, behavior) => _StartThickness = element.Margin;