Skip to content
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
3 changes: 3 additions & 0 deletions Dashboard/Controls/QueryPerformanceContent.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ private void ApplyQueryStoreFilters()

private void QueryStoreDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (!TabHelpers.IsDoubleClickOnRow((DependencyObject)e.OriginalSource)) return;
if (_databaseService == null) return;

if (QueryStoreDataGrid.SelectedItem is QueryStoreItem item)
Expand Down Expand Up @@ -793,6 +794,7 @@ private void QueryStoreDataGrid_MouseDoubleClick(object sender, MouseButtonEvent

private void ProcStatsDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (!TabHelpers.IsDoubleClickOnRow((DependencyObject)e.OriginalSource)) return;
if (_databaseService == null) return;

if (ProcStatsDataGrid.SelectedItem is ProcedureStatsItem item)
Expand Down Expand Up @@ -825,6 +827,7 @@ private void ProcStatsDataGrid_MouseDoubleClick(object sender, MouseButtonEventA

private void QueryStatsDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (!TabHelpers.IsDoubleClickOnRow((DependencyObject)e.OriginalSource)) return;
if (_databaseService == null) return;

if (QueryStatsDataGrid.SelectedItem is QueryStatsItem item)
Expand Down
17 changes: 17 additions & 0 deletions Dashboard/Helpers/TabHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ namespace PerformanceMonitorDashboard.Helpers
/// </summary>
public static class TabHelpers
{
/// <summary>
/// Returns true if a double-click originated from a DataGridRow (not a header).
/// Use at the top of MouseDoubleClick handlers to prevent header clicks from
/// triggering row actions.
/// </summary>
public static bool IsDoubleClickOnRow(DependencyObject originalSource)
{
var dep = originalSource;
while (dep != null)
{
if (dep is DataGridRow) return true;
if (dep is DataGridColumnHeader) return false;
dep = VisualTreeHelper.GetParent(dep);
}
return false;
}

/// <summary>
/// Material Design 300-level color palette for chart data series.
/// Soft pastels optimized for dark backgrounds, ordered to map 1:1
Expand Down
1 change: 1 addition & 0 deletions Dashboard/ManageServersWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ private void LoadServers()

private void ServersDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (!Helpers.TabHelpers.IsDoubleClickOnRow((DependencyObject)e.OriginalSource)) return;
EditSelectedServer();
}

Expand Down
1 change: 1 addition & 0 deletions Dashboard/ServerTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,7 @@ await Task.WhenAll(

private void HealthDataGrid_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
if (!Helpers.TabHelpers.IsDoubleClickOnRow((DependencyObject)e.OriginalSource)) return;
if (HealthDataGrid.SelectedItem is CollectionHealthItem item)
{
var logWindow = new CollectionLogWindow(item.CollectorName, _databaseService);
Expand Down
Loading