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
2 changes: 2 additions & 0 deletions src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,8 @@ private bool HasQueryStoreTab()
.Any(t => t.Content is QueryStoreGridControl);
}

public void TriggerQueryStore() => QueryStore_Click(null, new RoutedEventArgs());

private async void QueryStore_Click(object? sender, RoutedEventArgs e)
{
// If a QS tab already exists, always show connection dialog for a fresh tab
Expand Down
13 changes: 11 additions & 2 deletions src/PlanViewer.App/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,19 @@ private DockPanel CreatePlanTabContent(PlanViewerControl viewer)
Margin = new Avalonia.Thickness(6, 0, 0, 0),
VerticalContentAlignment = VerticalAlignment.Center,
HorizontalContentAlignment = HorizontalAlignment.Center,
IsEnabled = false,
Theme = (Avalonia.Styling.ControlTheme)this.FindResource("AppButton")!
};
ToolTip.SetTip(queryStoreBtn, "Connect to a server (Ctrl+N) to use Query Store");
ToolTip.SetTip(queryStoreBtn, "Open a Query Store session");
queryStoreBtn.Click += (_, _) =>
{
_queryCounter++;
var session = new QuerySessionControl(_credentialService, _connectionStore);
var tab = CreateTab($"Query {_queryCounter}", session);
MainTabControl.Items.Add(tab);
MainTabControl.SelectedItem = tab;
UpdateEmptyOverlay();
session.TriggerQueryStore();
};

var toolbar = new StackPanel
{
Expand Down
Loading