|
4 | 4 | x:Class="PlanViewer.App.Controls.QueryStoreGridControl" |
5 | 5 | Background="{DynamicResource BackgroundBrush}"> |
6 | 6 | <Grid RowDefinitions="Auto,Auto,*"> |
7 | | - <!-- Time Range Slicer --> |
8 | | - <local:TimeRangeSlicerControl x:Name="TimeRangeSlicer" Grid.Row="0"/> |
| 7 | + <!-- Time Range Slicer + Wait Stats Profile --> |
| 8 | + <Grid Grid.Row="0" x:Name="SlicerRow" ColumnDefinitions="2*,Auto,*"> |
| 9 | + <local:TimeRangeSlicerControl x:Name="TimeRangeSlicer" Grid.Column="0"/> |
| 10 | + <!-- Resizable separator with chevron overlay --> |
| 11 | + <GridSplitter x:Name="WaitStatsSplitter" Grid.Column="1" Width="14" |
| 12 | + Background="{DynamicResource BorderBrush}" |
| 13 | + ResizeDirection="Columns"/> |
| 14 | + <Button x:Name="WaitStatsChevronButton" Grid.Column="1" |
| 15 | + Content="»" |
| 16 | + Width="14" Height="28" Padding="0" |
| 17 | + FontSize="11" FontWeight="Bold" |
| 18 | + Background="Transparent" BorderThickness="0" |
| 19 | + Foreground="{DynamicResource ForegroundBrush}" |
| 20 | + HorizontalAlignment="Center" |
| 21 | + VerticalAlignment="Center" |
| 22 | + IsHitTestVisible="True" |
| 23 | + ToolTip.Tip="Collapse / expand wait stats panel" |
| 24 | + Click="WaitStatsChevron_Click"/> |
| 25 | + <local:WaitStatsProfileControl x:Name="WaitStatsProfile" Grid.Column="2"/> |
| 26 | + </Grid> |
9 | 27 |
|
10 | 28 | <!-- Toolbar --> |
11 | 29 | <Border Grid.Row="1" Background="{DynamicResource BackgroundDarkBrush}" Padding="8,6" |
|
91 | 109 | </StackPanel> |
92 | 110 | </Border> |
93 | 111 |
|
94 | | - <!-- DataGrid --> |
95 | | - <DataGrid Grid.Row="2" x:Name="ResultsGrid" |
| 112 | + <!-- DataGrid + loading overlay --> |
| 113 | + <Grid Grid.Row="2"> |
| 114 | + <DataGrid x:Name="ResultsGrid" |
96 | 115 | AutoGenerateColumns="False" |
97 | 116 | CanUserSortColumns="True" |
98 | 117 | CanUserReorderColumns="True" |
|
134 | 153 | <DataGridTextColumn Header="Query Hash" Binding="{ReflectionBinding QueryHash}" SortMemberPath="QueryHash" Width="150"/> |
135 | 154 | <DataGridTextColumn Header="Plan Hash" Binding="{ReflectionBinding QueryPlanHash}" SortMemberPath="QueryPlanHash" Width="150"/> |
136 | 155 | <DataGridTextColumn Header="Module" Binding="{ReflectionBinding ModuleName}" SortMemberPath="ModuleName" Width="140"/> |
| 156 | + <DataGridTemplateColumn SortMemberPath="WaitGrandTotalSort" Width="160"> |
| 157 | + <DataGridTemplateColumn.Header> |
| 158 | + <StackPanel Orientation="Horizontal" Spacing="4"> |
| 159 | + <Button Content="v" Width="20" Height="18" Padding="0" |
| 160 | + FontSize="10" FontWeight="Bold" |
| 161 | + Background="Transparent" BorderThickness="1" |
| 162 | + BorderBrush="{DynamicResource ForegroundMutedBrush}" |
| 163 | + Foreground="{DynamicResource ForegroundBrush}" |
| 164 | + ToolTip.Tip="Toggle value (v) / percent (%) stacked bar" |
| 165 | + Click="WaitModeToggle_Click"/> |
| 166 | + <TextBlock Text="Wait Profile" VerticalAlignment="Center"/> |
| 167 | + </StackPanel> |
| 168 | + </DataGridTemplateColumn.Header> |
| 169 | + <DataGridTemplateColumn.CellTemplate> |
| 170 | + <DataTemplate x:DataType="local:QueryStoreRow"> |
| 171 | + <local:WaitProfileBarControl Height="14" Margin="2,1" |
| 172 | + Profile="{Binding WaitProfile}" |
| 173 | + HighlightCategory="{Binding WaitHighlightCategory}" |
| 174 | + PercentMode="{Binding WaitPercentMode}" |
| 175 | + MaxGrandTotalRatio="{Binding WaitMaxGrandTotal}"/> |
| 176 | + </DataTemplate> |
| 177 | + </DataGridTemplateColumn.CellTemplate> |
| 178 | + </DataGridTemplateColumn> |
137 | 179 | <DataGridTextColumn Header="Last Executed (Local)" Binding="{ReflectionBinding LastExecutedLocal}" SortMemberPath="LastExecutedLocal" Width="160"/> |
138 | 180 | <DataGridTemplateColumn Header="Executions" SortMemberPath="ExecsSort" Width="100"> |
139 | 181 | <DataGridTemplateColumn.CellTemplate> |
|
277 | 319 | </DataGridTemplateColumn> |
278 | 320 | </DataGrid.Columns> |
279 | 321 | </DataGrid> |
| 322 | + <!-- Loading overlay --> |
| 323 | + <Border x:Name="GridLoadingOverlay" IsVisible="False" |
| 324 | + Background="#80000000" CornerRadius="0" |
| 325 | + HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
| 326 | + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="8"> |
| 327 | + <ProgressBar IsIndeterminate="True" Width="200" Height="4"/> |
| 328 | + <TextBlock x:Name="GridLoadingText" Text="Fetching plans..." |
| 329 | + FontSize="12" HorizontalAlignment="Center" |
| 330 | + Foreground="{DynamicResource ForegroundBrush}"/> |
| 331 | + </StackPanel> |
| 332 | + </Border> |
| 333 | + </Grid> |
280 | 334 | </Grid> |
281 | 335 | </UserControl> |
0 commit comments