Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DYN-7463] related : force ScrollViewer to focus on loaded #63

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions TuneUp/TuneUpWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@
Grid.Row="2"
Grid.Column="0"
Grid.ColumnSpan="2">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ScrollViewer VerticalScrollBarVisibility="Auto"
Focusable="True">
<StackPanel >
<!-- Latest Run -->
<TextBlock Text="Latest run"
Expand All @@ -467,7 +468,8 @@
SelectionChanged="NodeAnalysisTable_SelectionChanged"
PreviewMouseDown="NodeAnalysisTable_PreviewMouseDown"
MouseLeave="NodeAnalysisTable_MouseLeave"
PreviewMouseWheel="DataGrid_PreviewMouseWheel">
PreviewMouseWheel="DataGrid_PreviewMouseWheel"
Loaded="ScrollViewer_Loaded">
<DataGrid.Columns>
<!-- Execution Order -->
<DataGridTextColumn Width="40" Header="#">
Expand Down Expand Up @@ -526,7 +528,8 @@
SelectionChanged="NodeAnalysisTable_SelectionChanged"
PreviewMouseDown="NodeAnalysisTable_PreviewMouseDown"
MouseLeave="NodeAnalysisTable_MouseLeave"
PreviewMouseWheel="DataGrid_PreviewMouseWheel">
PreviewMouseWheel="DataGrid_PreviewMouseWheel"
Loaded="ScrollViewer_Loaded">
<DataGrid.Columns>
<!-- Execution Order -->
<DataGridTextColumn Width="40" Binding="{Binding Converter={StaticResource ExecutionOrderNumberConverter}}">
Expand Down Expand Up @@ -583,7 +586,8 @@
SelectionChanged="NodeAnalysisTable_SelectionChanged"
PreviewMouseDown="NodeAnalysisTable_PreviewMouseDown"
MouseLeave="NodeAnalysisTable_MouseLeave"
PreviewMouseWheel="DataGrid_PreviewMouseWheel">
PreviewMouseWheel="DataGrid_PreviewMouseWheel"
Loaded="ScrollViewer_Loaded">
<DataGrid.Columns>
<!-- Execution Order -->
<DataGridTextColumn Width="40" />
Expand Down
12 changes: 12 additions & 0 deletions TuneUp/TuneUpWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ private T FindParent<T>(DependencyObject child) where T : DependencyObject
}
}

/// <summary>
/// Sets focus on the ScrollViewer when it is loaded to ensure immediate scroll functionality.
/// </summary>
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();
Expand Down