/// <summary> /// Scrolls the DataGrid even when mouse is not over it. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Window_PreviewMouseWheel(object sender, MouseWheelEventArgs e) { try { if (Scroller.IsMouseOver == false) { if (e.Delta < 0) { Scroller.LineDown(); Scroller.LineDown(); Scroller.LineDown(); } if (e.Delta > 0) { Scroller.LineUp(); Scroller.LineUp(); Scroller.LineUp(); } } } catch (Exception ex) { HandleException(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
private void UpArrow_MouseDown(object sender, MouseButtonEventArgs e) { double n = Scroller.VerticalOffset; for (int index = 0; index < 30; index++) { Scroller.LineUp(); } if (Scroller.VerticalOffset < 500) { UpArrow.Visibility = Visibility.Hidden; } DownArrow.Visibility = Visibility.Visible; }
private void LineUp(object sender, RoutedEventArgs e) { Scroller.LineUp(); }