Esempio n. 1
0
        private void UpdatePosition()
        {
            GeneralTransform transform       = base.AssociatedObject.TransformToVisual(this.RootElement);
            Point            transformOffset = MouseDragElementBehavior.GetTransformOffset(transform);

            this.X = transformOffset.X;
            this.Y = transformOffset.Y;
        }
Esempio n. 2
0
 private void UpdatePosition(Point point)
 {
     if (!this.settingPosition && base.AssociatedObject != null)
     {
         GeneralTransform transform       = base.AssociatedObject.TransformToVisual(this.RootElement);
         Point            transformOffset = MouseDragElementBehavior.GetTransformOffset(transform);
         double           x = double.IsNaN(point.X) ? 0.0 : (point.X - transformOffset.X);
         double           y = double.IsNaN(point.Y) ? 0.0 : (point.Y - transformOffset.Y);
         this.ApplyTranslation(x, y);
     }
 }