/// <summary> /// Scroll the desired element into the ScrollViewer's viewport. /// /// </summary> /// <param name="viewer">The ScrollViewer.</param><param name="element">The element to scroll into view.</param><exception cref="T:System.ArgumentNullException"><paramref name="viewer"/> is null. /// </exception><exception cref="T:System.ArgumentNullException"><paramref name="element"/> is null. /// </exception> public static void ScrollIntoView(this ScrollViewer viewer, FrameworkElement element) { if (viewer == null) { throw new ArgumentNullException("viewer"); } if (element == null) { throw new ArgumentNullException("element"); } ScrollViewerExtensions.ScrollIntoView(viewer, element, 0.0, 0.0, (Duration)TimeSpan.Zero); }
/// <summary> /// Scroll the desired element into the ScrollViewer's viewport. /// /// </summary> /// <param name="viewer">The ScrollViewer.</param><param name="element">The element to scroll into view.</param><exception cref="T:System.ArgumentNullException"><paramref name="viewer"/> is null. /// </exception><exception cref="T:System.ArgumentNullException"><paramref name="element"/> is null. /// </exception> public static void ScrollIntoView(this ScrollViewer viewer, FrameworkElement element) { if (viewer == null) { throw new ArgumentNullException("viewer"); } if (element == null) { throw new ArgumentNullException("element"); } ScrollViewerExtensions.ScrollIntoView(viewer, element, 0.0, 112.0, TimeSpan.FromSeconds(0.25)); }