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
20 changes: 14 additions & 6 deletions src/PlanViewer.App/Controls/QuerySessionControl.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@
<Border Grid.Row="0" Background="{DynamicResource BackgroundDarkBrush}" Padding="8,6"
BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<DockPanel>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left" Spacing="4">
<TextBlock x:Name="StatusText" DockPanel.Dock="Right"
HorizontalAlignment="Right" VerticalAlignment="Center"
FontSize="11" Foreground="{DynamicResource ForegroundBrush}"
TextTrimming="CharacterEllipsis" Margin="8,0,0,0"/>
<WrapPanel Orientation="Horizontal">
<WrapPanel.Styles>
<Style Selector="Button">
<Setter Property="Margin" Value="0,2,4,2"/>
</Style>
<Style Selector="ComboBox">
<Setter Property="Margin" Value="0,2,4,2"/>
</Style>
</WrapPanel.Styles>
<Button x:Name="ConnectButton" Content="Connect" Click="Connect_Click"
Height="28" Padding="8,0" FontSize="12"
Theme="{StaticResource AppButton}"
Expand Down Expand Up @@ -84,11 +96,7 @@
Height="28" Padding="10,0" FontSize="12"
Theme="{StaticResource AppButton}"
ToolTip.Tip="Configure SQL formatting options"/>
</StackPanel>
<TextBlock x:Name="StatusText" DockPanel.Dock="Right"
HorizontalAlignment="Right" VerticalAlignment="Center"
FontSize="11" Foreground="{DynamicResource ForegroundBrush}"
TextTrimming="CharacterEllipsis"/>
</WrapPanel>
</DockPanel>
</Border>

Expand Down
6 changes: 6 additions & 0 deletions src/PlanViewer.App/MainWindow.PlanViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,12 @@ private async Task GetActualPlanFromFile(PlanViewerControl viewer)
// Replace loading content with the actual plan
var actualViewer = new PlanViewerControl();
actualViewer.Metadata = metadata;
// Inherit the connection used to run the repro so schema lookups
// (Show Indexes, Show Table Definition) remain available on the
// new plan tab.
actualViewer.ConnectionString = connectionString;
actualViewer.SetConnectionServices(_credentialService, _connectionStore);
actualViewer.SetConnectionStatus(dialog.ResultConnection.ServerName, database);
actualViewer.LoadPlan(actualPlanXml, "Actual Plan", queryText);

tab.Content = CreatePlanTabContent(actualViewer);
Expand Down
Loading