diff --git a/src/BIOSBuddy/MainWindow.xaml.cs b/src/BIOSBuddy/MainWindow.xaml.cs index 34c4e03..fc17de9 100644 --- a/src/BIOSBuddy/MainWindow.xaml.cs +++ b/src/BIOSBuddy/MainWindow.xaml.cs @@ -800,30 +800,10 @@ private void ShowVersionInfo() } } - private bool IsUserControlVisibleInScrollViewer(UserControl userControl, ScrollViewer scrollViewer) - { - // Get the bounds of the UserControl - var controlBounds = userControl.TransformToAncestor(scrollViewer) - .TransformBounds(new Rect(0.0, 0.0, userControl.ActualWidth, userControl.ActualHeight)); - - // Get the visible region of the ScrollViewer - var visibleRegion = new Rect(scrollViewer.HorizontalOffset, scrollViewer.VerticalOffset, scrollViewer.ViewportWidth, scrollViewer.ViewportHeight); - - // Check if the UserControl is within the visible region of the ScrollViewer - return visibleRegion.IntersectsWith(controlBounds); - } - private void SaveVisibleUserControl() { - foreach (UserControl userControl in ItemsControlControls.Items) - { - if (!IsUserControlVisibleInScrollViewer(userControl, ScrollViewerControls)) continue; - - Settings.Default.ScrollViewerVerticalOffset = ScrollViewerControls.VerticalOffset; - Settings.Default.Save(); - - break; - } + Settings.Default.ScrollViewerVerticalOffset = ScrollViewerControls.VerticalOffset; + Settings.Default.Save(); } private void ScrollViewerControls_OnLoaded(object sender, RoutedEventArgs e) @@ -834,6 +814,7 @@ private void ScrollViewerControls_OnLoaded(object sender, RoutedEventArgs e) ItemsControlControls.UpdateLayout(); ScrollViewerControls.UpdateLayout(); + if (Settings.Default.ScrollViewerVerticalOffset < ScrollViewerControls.ScrollableHeight) { ScrollViewerControls.ScrollToVerticalOffset(Settings.Default.ScrollViewerVerticalOffset); diff --git a/src/DCSFPCommon b/src/DCSFPCommon index edcc9fa..192175c 160000 --- a/src/DCSFPCommon +++ b/src/DCSFPCommon @@ -1 +1 @@ -Subproject commit edcc9faa960a5fb73026faf5d1fd021316884457 +Subproject commit 192175c81f50e23339307ba6ed19dba7dfea37f2