feat: respect AllowAutoHide in DataGrid.

This commit is contained in:
rabbitism 2024-08-15 17:41:31 +08:00
parent ecde71c999
commit a3ed11fa10
No known key found for this signature in database

View File

@ -471,6 +471,7 @@
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="SelectionMode" Value="Extended" />
<Setter Property="GridLinesVisibility" Value="None" />
<Setter Property="ScrollViewer.AllowAutoHide" Value="True"></Setter>
<Setter Property="HorizontalGridLinesBrush" Value="{DynamicResource DataGridLineBrush}" />
<Setter Property="VerticalGridLinesBrush" Value="{DynamicResource DataGridLineBrush}" />
<Setter Property="DropLocationIndicatorTemplate">
@ -570,5 +571,15 @@
<Setter Property="IsVisible" Value="False" />
</Style>
</Style>
<Style Selector="^[(ScrollViewer.AllowAutoHide)=False]">
<Style Selector="^ /template/ DataGridRowsPresenter#PART_RowsPresenter">
<Setter Property="Grid.RowSpan" Value="1"></Setter>
<Setter Property="Grid.ColumnSpan" Value="2"></Setter>
</Style>
<Style Selector="^ /template/ DataGridColumnHeadersPresenter#PART_ColumnHeadersPresenter">
<Setter Property="Grid.ColumnSpan" Value="1"></Setter>
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>