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); }
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(); } } }