Esempio n. 1
0
        /// <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);
            }
        }
Esempio n. 2
0
        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();
 }