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.GetVisualDescendents())
                {
                    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!");
            });
        }
Exemplo n.º 2
0
        /// <summary>Scrolls the content area of a container object in order to display the control within the visible region (viewport) of the container.</summary>
        // Token: 0x0600287B RID: 10363 RVA: 0x000BC808 File Offset: 0x000BAA08
        void IScrollItemProvider.ScrollIntoView()
        {
            TreeViewItemAutomationPeer treeViewItemAutomationPeer = this.GetWrapperPeer() as TreeViewItemAutomationPeer;

            if (treeViewItemAutomationPeer != null)
            {
                IScrollItemProvider scrollItemProvider = treeViewItemAutomationPeer;
                scrollItemProvider.ScrollIntoView();
                return;
            }
            this.RecursiveScrollIntoView();
        }
        public virtual void TreeViewItemPeerScrollNoParent()
        {
            TreeViewItem item = new TreeViewItem();
            TreeViewItemAutomationPeer peer     = null;
            IScrollItemProvider        provider = null;

            TestAsync(
                item,
                () => peer     = FrameworkElementAutomationPeer.CreatePeerForElement(item) as TreeViewItemAutomationPeer,
                () => provider = peer.GetPattern(PatternInterface.ScrollItem) as IScrollItemProvider,
                () => provider.ScrollIntoView());
        }
        void IScrollItemProvider.ScrollIntoView()
        {
            TreeViewItemAutomationPeer wrapperPeer = GetWrapperPeer() as TreeViewItemAutomationPeer;

            if (wrapperPeer != null)
            {
                IScrollItemProvider iScrollItemProvider = wrapperPeer as IScrollItemProvider;
                iScrollItemProvider.ScrollIntoView();
            }
            else
            {
                RecursiveScrollIntoView();
            }
        }
Exemplo n.º 5
0
 void IScrollItemProvider.ScrollIntoView() => publicIScrollItemProvider.ScrollIntoView();
Exemplo n.º 6
0
 public void ScrollIntoView()
 {
     provider.ScrollIntoView();
 }
Exemplo n.º 7
0
 public void ScrollIntoView()
 {
     source.ScrollIntoView();
 }