private void ScrollViewer(object sender, RoutedEventArgs e)
        {
            /*
             *  UIElement.UpdateLayout
             *      Ensures that all positions of child objects of
             *      a UIElement are properly updated for layout.
             */

            ScrollViewer2.UpdateLayout();

            /*
             *  ScrollViewer.ChangeView
             *      Causes the ScrollViewer to load a new view into
             *      the viewport using the specified offsets and zoom factor.
             */

            // Programmatically scroll to bottom
            ScrollViewer2.ChangeView(
                0.0f,            // horizontalOffset
                double.MaxValue, // verticalOffset
                1.0f             // zoomFactor
                );

            // Another way to programmatically scroll to bottom
            // But above way is better
            //ScrollViewer1.ScrollToVerticalOffset(ScrollViewer1.ScrollableHeight);
        }
Beispiel #2
0
        private void sv3_ScrollChanged(object sender, ScrollChangedEventArgs e)
        {
            ScrollViewer sv = e.OriginalSource as ScrollViewer;

            if (sv != null)
            {
                ScrollViewer2.ScrollToVerticalOffset(sv.VerticalOffset);
            }
        }
 private void ListBox2_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
 {
     if (e.Delta < 0)
     {
         ScrollViewer2.LineDown();
     }
     else
     {
         ScrollViewer2.LineUp();
     }
 }
Beispiel #4
0
 private void CompetitionsToSelect_OnPreviewMouseWheel(object sender, MouseWheelEventArgs e)
 {
     ScrollViewer2.ScrollToVerticalOffset(ScrollViewer2.VerticalOffset - e.Delta);
 }
Beispiel #5
0
 private void ScrollViewer1_ScrollChanged(object sender, ScrollChangedEventArgs e)
 {
     ScrollViewer2.ScrollToVerticalOffset(ScrollViewer1.VerticalOffset);
 }