diff --git a/TuneUp/TuneUpWindow.xaml b/TuneUp/TuneUpWindow.xaml index 3c6ae7f..157e58c 100644 --- a/TuneUp/TuneUpWindow.xaml +++ b/TuneUp/TuneUpWindow.xaml @@ -453,7 +453,8 @@ Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"> - + + PreviewMouseWheel="DataGrid_PreviewMouseWheel" + Loaded="ScrollViewer_Loaded"> @@ -526,7 +528,8 @@ SelectionChanged="NodeAnalysisTable_SelectionChanged" PreviewMouseDown="NodeAnalysisTable_PreviewMouseDown" MouseLeave="NodeAnalysisTable_MouseLeave" - PreviewMouseWheel="DataGrid_PreviewMouseWheel"> + PreviewMouseWheel="DataGrid_PreviewMouseWheel" + Loaded="ScrollViewer_Loaded"> @@ -583,7 +586,8 @@ SelectionChanged="NodeAnalysisTable_SelectionChanged" PreviewMouseDown="NodeAnalysisTable_PreviewMouseDown" MouseLeave="NodeAnalysisTable_MouseLeave" - PreviewMouseWheel="DataGrid_PreviewMouseWheel"> + PreviewMouseWheel="DataGrid_PreviewMouseWheel" + Loaded="ScrollViewer_Loaded"> diff --git a/TuneUp/TuneUpWindow.xaml.cs b/TuneUp/TuneUpWindow.xaml.cs index 2b11968..8a490c3 100644 --- a/TuneUp/TuneUpWindow.xaml.cs +++ b/TuneUp/TuneUpWindow.xaml.cs @@ -148,6 +148,18 @@ private T FindParent(DependencyObject child) where T : DependencyObject } } + /// + /// Sets focus on the ScrollViewer when it is loaded to ensure immediate scroll functionality. + /// + private void ScrollViewer_Loaded(object sender, RoutedEventArgs e) + { + var scrollViewer = sender as ScrollViewer; + if (scrollViewer != null) + { + scrollViewer.Focus(); + } + } + private void RecomputeGraph_Click(object sender, RoutedEventArgs e) { (LatestRunTable.DataContext as TuneUpWindowViewModel).ResetProfiling();