예제 #1
0
        public static bool HitScrollBar(this FrameworkElement e, Point pos)
        {
            HitTestResult result = VisualTreeHelper.HitTest(e, pos);

            if (result != null)
            {
                var scrollbar = WpfHelper.FindAncestor <ScrollBar>(result.VisualHit);
                return(scrollbar != null);
            }
            return(false);
        }
예제 #2
0
        void AttemptToScrollDown(int speed)
        {
            // Attemp to scroll up
            ScrollViewer sv = WpfHelper.FindFirstDescendantOfType <ScrollViewer>(this.mainControl);

            if (sv != null)
            {
                for (int i = 1; i <= speed; i++)
                {
                    sv.LineDown();
                }
            }
        }