Ejemplo n.º 1
0
        public void UpdatePosition()
        {
            var pos = VisualExtension.GetMousePosition();

            HorizontalOffset = pos.X / _deviceScaleX - 8;
            VerticalOffset   = pos.Y / _deviceScaleY - 8;
        }
Ejemplo n.º 2
0
        private static bool IsDragging(object sender, MouseEventArgs e)
        {
            if (_dragging || _previous != sender || e.LeftButton != MouseButtonState.Pressed ||
                VisualExtension.GetMousePosition().DistanceTo(_startingPoint) < 3d)
            {
                return(false);
            }
            if (IgnoreSpecialControls(sender, e))
            {
                _previous = null;
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
        private static void Element_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (!e.Handled)
            {
                var element = sender as FrameworkElement;
                if (element != null && !IgnoreSpecialControls(sender, e))
                {
                    _previous      = element;
                    _startingPoint = VisualExtension.GetMousePosition();
                    return;
                }
            }

            _previous = null;
        }