System.Windows.Controls.SelectorSelectionAdapter.ResetScrollViewer C# (CSharp) Method

ResetScrollViewer() private method

If the control contains a ScrollViewer, this will reset the viewer to be scrolled to the top.
private ResetScrollViewer ( ) : void
return void
        private void ResetScrollViewer()
        {
            if(SelectorControl != null)
            {
                ScrollViewer sv = SelectorControl.GetLogicalChildrenBreadthFirst().OfType<ScrollViewer>().FirstOrDefault();
                if(sv != null)
                {
                    sv.ScrollToTop();
                }
            }
        }