/// <summary> /// Scrolls a given item container into the view. /// </summary> /// <param name="itemsControl">The items control that contains /// the item container.</param> /// <param name="itemContainer">The item container to scroll into /// view.</param> protected override void ScrollIntoView(TItemsControl itemsControl, TItemContainerType itemContainer) { ScrollViewer scrollHost = itemsControl.GetScrollHost(); if (scrollHost != null) { scrollHost.ScrollIntoView(itemContainer, 10, 10, ScrollItemAnimationDuration); } }
/// <summary> /// Scrolls a given item container into the view. /// </summary> /// <param name="itemsControl">The items control that contains /// the item container.</param> /// <param name="itemContainer">The item container to scroll into /// view.</param> protected override void ScrollIntoView(ItemsControl itemsControl, TreeViewItem itemContainer) { TreeView content = this.Content as TreeView; if (content != null) { ScrollViewer scrollViewer = content.GetScrollHost(); if (scrollViewer != null) { scrollViewer.ScrollIntoView(itemContainer, 10, 10, ScrollItemAnimationDuration); } } }