public virtual void TreeViewItemPeerScroll()
 {
     TreeView view = new TreeView { Height = 20, ItemsSource = new int[] { 1, 2, 3, 4, 5 } };
     TreeViewItem item = null;
     TreeViewItemAutomationPeer peer = null;
     IScrollItemProvider provider = null;
     TestAsync(
         5,
         view,
         () => item = view.ItemContainerGenerator.ContainerFromIndex(4) as TreeViewItem,
         () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(item) as TreeViewItemAutomationPeer,
         () => provider = peer.GetPattern(PatternInterface.ScrollItem) as IScrollItemProvider,
         () => provider.ScrollIntoView(),
         () =>
         {
             foreach (DependencyObject obj in view.GetVisualChildren())
             {
                 ScrollViewer viewer = obj as ScrollViewer;
                 if (viewer != null)
                 {
                     Assert.AreNotEqual(0, viewer.VerticalOffset, "ScrollHost was not scrolled!");
                     return;
                 }
             }
             Assert.Fail("Did not find the ScrollHost!");
         });
 }