Microsoft.Windows.Controls.Ribbon.RibbonGallery.ScrollIntoView C# (CSharp) Method

ScrollIntoView() public method

This method allows a particular item to be scrolled into view
Note that this method currently does not support the virtualization
public ScrollIntoView ( object item ) : void
item object
return void
        public void ScrollIntoView(object item)
        {
            if (item != null)
            {
                // This is a fast path to scroll to the selected or the highlighted item

                if (VerifyEqual(item, SelectedItem) && _selectedContainers.Count > 0)
                {
                    _selectedContainers[0].BringIntoView();
                }
                else if (VerifyEqual(item, HighlightedItem) && _highlightedContainer != null)
                {
                    _highlightedContainer.BringIntoView();
                }
                else
                {
                    // If this a request for an arbitrary item then we need to
                    // find its container and then scroll that into view.

                    RibbonGalleryCategory category = null;
                    RibbonGalleryItem galleryItem = null;

                    bool ignoreItemContainerGeneratorStatus = true;
                    if (ContainsItem(item, ignoreItemContainerGeneratorStatus, out category, out galleryItem) &&
                        galleryItem != null)
                    {
                        galleryItem.BringIntoView();
                    }
                }
            }
        }
RibbonGallery