예제 #1
0
 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);
 }
예제 #2
0
 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;
 }
예제 #3
0
 public ThicknessObjectMover([NotNull] FrameworkElement element, [NotNull] DragBehavior behavior) : base(element, behavior) => _StartThickness = element.Margin;