Пример #1
0
 /// <summary>
 /// Drags the map, if the mouse was succesfully captured.
 /// </summary>
 /// <param name="e">The MouseEventArgs that contains the event data.</param>
 protected override void OnMouseMove(MouseEventArgs e)
 {
     base.OnMouseMove(e);
     if (_mouseCaptured)
     {
         BeginUpdate();
         Point position = e.GetPosition(null);
         _offsetX.Translate(position.X - _previousMouse.X);
         _offsetY.Translate(position.Y - _previousMouse.Y);
         _previousMouse = position;
         EndUpdate();
     }
 }
Пример #2
0
        /// <summary>Drags the map, if the mouse was succesfully captured.</summary>
        /// <param name="e">The MouseEventArgs that contains the event data.</param>
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            Point position = e.GetPosition(null);

            if (_mouseCaptured)
            {
                this.BeginUpdate();
                _offsetX.Translate(position.X - _previousMouse.X);
                _offsetY.Translate(position.Y - _previousMouse.Y);
                _previousMouse = position;
                this.EndUpdate();
            }
            else
            {
                var location = GetLocation(position);
                ActualCursorLatitude  = location.Y;
                ActualCursorLongitude = location.X;
            }
        }