Ejemplo n.º 1
0
        internal override void OnMouseUp(MouseButtonEventArgs e)
        {
            if (selectPosition.HasValue && e.ChangedButton == dragButton)
            {
                if (beginSelect)
                {
                    border.Visibility = Visibility.Collapsed;
                    border.Dispose();
                    border = null;

                    beginSelect = false;
                }

                selectPosition = null;
            }
        }
Ejemplo n.º 2
0
        internal override void OnMouseMove(MouseEventArgs e)
        {
            if (selectPosition.HasValue)
            {
                if (!beginSelect)
                {
                    // detect select
                    var dragDiff = selectPosition.Value - e.GetPosition(TreeView);
                    if ((Math.Abs(dragDiff.X) > SystemParameters.MinimumHorizontalDragDistance || Math.Abs(dragDiff.Y) > SystemParameters.MinimumVerticalDragDistance))
                    {
                        // begin select
                        border      = new BorderSelectionAdorner(TreeView);
                        beginSelect = true;
                    }
                }

                if (beginSelect)
                {
                    HandleInput(e);
                }
            }
        }