mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-02 15:50:49 +08:00
feat: implementation for DataGrid.
This commit is contained in:
@@ -15,8 +15,9 @@
|
||||
<TabItem Header="DataGrid">
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||
<ToggleSwitch Content="Disable" Name="DisableToggle" />
|
||||
<ToggleSwitch Content="ScrollViewerHide" Name="ScrollViewerHide" />
|
||||
<ToggleSwitch Content="Enable" Name="enable" IsChecked="True" />
|
||||
<ToggleSwitch Content="Inset Content" Name="inset" />
|
||||
<ToggleSwitch Content="ScrollBar Auto Hide" Name="autohide"></ToggleSwitch>
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1"
|
||||
Margin="8"
|
||||
@@ -25,8 +26,9 @@
|
||||
CanUserSortColumns="True"
|
||||
HeadersVisibility="All"
|
||||
IsReadOnly="True"
|
||||
ScrollViewer.AllowAutoHide="{Binding #ScrollViewerHide.IsChecked}"
|
||||
IsEnabled="{Binding #DisableToggle.IsChecked}"
|
||||
Classes.InsetContent="{Binding #inset.IsChecked}"
|
||||
ScrollViewer.AllowAutoHide="{Binding #autohide.IsChecked}"
|
||||
IsEnabled="{Binding #enable.IsChecked}"
|
||||
ItemsSource="{Binding GridData1}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
|
||||
@@ -530,6 +530,7 @@
|
||||
Name="PART_VerticalScrollbar"
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
AllowAutoHide="{Binding Path=(ScrollViewer.AllowAutoHide), RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Orientation="Vertical" />
|
||||
|
||||
<Grid
|
||||
@@ -540,6 +541,7 @@
|
||||
<ScrollBar
|
||||
Name="PART_HorizontalScrollbar"
|
||||
Grid.Column="1"
|
||||
AllowAutoHide="{Binding Path=(ScrollViewer.AllowAutoHide), RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Height="{DynamicResource ScrollBarSize}"
|
||||
Orientation="Horizontal" />
|
||||
</Grid>
|
||||
@@ -572,7 +574,7 @@
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[(ScrollViewer.AllowAutoHide)=False]">
|
||||
<Style Selector="^.InsetContent">
|
||||
<Style Selector="^ /template/ DataGridRowsPresenter#PART_RowsPresenter">
|
||||
<Setter Property="Grid.RowSpan" Value="1" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="2" />
|
||||
|
||||
Reference in New Issue
Block a user