示例#1
0
        internal override void OnMouseMove(Input.MouseEventArgs e)
        {
            base.OnMouseMove(e);
            if (!IsEnabled)
            {
                return;
            }
            if (!IsLeftButtonDown)
            {
                return;
            }
            if (timer != null)
            {
                return;
            }
            Point position = e.GetPosition(TreeView);

            if (position.Y < scrollBorderSize)
            {
                //scroll down
                ScrollContinously(-scrollDelta);
            }
            else if ((TreeView.RenderSize.Height - position.Y) < scrollBorderSize)
            {
                //scroll up
                ScrollContinously(scrollDelta);
            }
        }
示例#2
0
 protected override void OnMouseMove(Input.MouseEventArgs e)
 {
     if (e.LeftButton == Input.MouseButtonState.Pressed && NavigationTriggerMode == Controls.NavigationTriggerMode.MouseDrag)
     {
         e.Handled = true;
         Point  currentPosition = e.GetPosition(null);
         double baseX           = _currentPageIndex * this.Width;
         double diffX           = currentPosition.X - _mouseDragStartPosition.X;
         //foreach (FrameworkElement child in InternalChildren)
         //{
         //    TranslateTransform tt = child.RenderTransform as TranslateTransform;
         //    tt.X = baseX + diffX;
         //    tt.X = 500;
         //}
         _draggedDistance = diffX;
     }
     base.OnMouseMove(e);
 }