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