This commit is contained in:
Wiesław Šoltés 2021-08-11 20:53:02 +02:00
Родитель d835689258
Коммит aa1926943a
15 изменённых файлов: 86 добавлений и 124 удалений

Просмотреть файл

@ -1,23 +0,0 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:g="using:TemplatedDataGrid">
<Design.PreviewWith>
<g:DataGrid />
</Design.PreviewWith>
<Style Selector="g|DataGrid">
<Setter Property="Template">
<ControlTemplate>
<Grid Name="PART_Root">
<g:DataGridColumnHeadersPresenter Name="PART_ColumnHeadersPresenter"/>
<g:DataGridRowsPresenter Name="PART_RowsPresenter"/>
</Grid>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="g|DataGrid /template/ Grid#PART_Root > Separator">
<Setter Property="Background" Value="Gray" />
</Style>
<Style Selector="g|DataGrid /template/ Grid#PART_Root > GridSplitter">
<Setter Property="Background" Value="Transparent" />
</Style>
</Styles>

Просмотреть файл

@ -1,15 +0,0 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:g="using:TemplatedDataGrid">
<Design.PreviewWith>
<g:DataGridCell />
</Design.PreviewWith>
<Style Selector="g|DataGridCell">
<Setter Property="Template">
<ControlTemplate>
<ContentControl Content="{Binding}"
ContentTemplate="{TemplateBinding CellTemplate}"/>
</ControlTemplate>
</Setter>
</Style>
</Styles>

Просмотреть файл

@ -1,14 +0,0 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:g="using:TemplatedDataGrid">
<Design.PreviewWith>
<g:DataGridColumnHeader />
</Design.PreviewWith>
<Style Selector="g|DataGridColumnHeader">
<Setter Property="Template">
<ControlTemplate>
<ContentControl Content="{TemplateBinding Header}" />
</ControlTemplate>
</Setter>
</Style>
</Styles>

Просмотреть файл

@ -1,14 +0,0 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:g="using:TemplatedDataGrid">
<Design.PreviewWith>
<g:DataGridColumnHeadersPresenter />
</Design.PreviewWith>
<Style Selector="g|DataGridColumnHeadersPresenter">
<Setter Property="Template">
<ControlTemplate>
<Grid Name="PART_Root" />
</ControlTemplate>
</Setter>
</Style>
</Styles>

Просмотреть файл

@ -1,14 +0,0 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:g="using:TemplatedDataGrid">
<Design.PreviewWith>
<g:DataGridRow />
</Design.PreviewWith>
<Style Selector="g|DataGridRow">
<Setter Property="Template">
<ControlTemplate>
<Grid Name="PART_Root" />
</ControlTemplate>
</Setter>
</Style>
</Styles>

Просмотреть файл

@ -1,34 +0,0 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:g="using:TemplatedDataGrid">
<Design.PreviewWith>
<g:DataGridRowsPresenter />
</Design.PreviewWith>
<Style Selector="g|DataGridRowsPresenter">
<Setter Property="Template">
<ControlTemplate>
<ListBox Name="PART_ListBox"
Items="{TemplateBinding Items}"
SelectedItem="{TemplateBinding SelectedItem}">
<ListBox.Styles>
<Style Selector="ListBox">
<Setter Property="Background" Value="Transparent"/>
</Style>
</ListBox.Styles>
<ListBox.Styles>
<Style Selector="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
</Style>
</ListBox.Styles>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</ControlTemplate>
</Setter>
</Style>
</Styles>

Просмотреть файл

@ -0,0 +1,81 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:g="using:TemplatedDataGrid">
<Style Selector="g|DataGrid">
<Setter Property="Template">
<ControlTemplate>
<Grid Name="PART_Root">
<g:DataGridColumnHeadersPresenter Name="PART_ColumnHeadersPresenter"/>
<g:DataGridRowsPresenter Name="PART_RowsPresenter"/>
</Grid>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="g|DataGrid /template/ Grid#PART_Root > Separator">
<Setter Property="Background" Value="Gray" />
</Style>
<Style Selector="g|DataGrid /template/ Grid#PART_Root > GridSplitter">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="g|DataGridRowsPresenter">
<Setter Property="Template">
<ControlTemplate>
<ListBox Name="PART_ListBox"
Items="{TemplateBinding Items}"
SelectedItem="{TemplateBinding SelectedItem}"/>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="g|DataGridRowsPresenter /template/ ListBox#PART_ListBox">
<Setter Property="Background" Value="Transparent" />
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
<Style Selector="g|DataGridRowsPresenter /template/ ListBox#PART_ListBox > ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
</Style>
<Style Selector="g|DataGridColumnHeadersPresenter">
<Setter Property="Template">
<ControlTemplate>
<Grid Name="PART_Root" />
</ControlTemplate>
</Setter>
</Style>
<Style Selector="g|DataGridColumnHeader">
<Setter Property="Template">
<ControlTemplate>
<ContentControl Content="{TemplateBinding Header}" />
</ControlTemplate>
</Setter>
</Style>
<Style Selector="g|DataGridRow">
<Setter Property="Template">
<ControlTemplate>
<Grid Name="PART_Root" />
</ControlTemplate>
</Setter>
</Style>
<Style Selector="g|DataGridCell">
<Setter Property="Template">
<ControlTemplate>
<ContentControl Content="{Binding}"
ContentTemplate="{TemplateBinding CellTemplate}"/>
</ControlTemplate>
</Setter>
</Style>
</Styles>

Просмотреть файл

@ -7,11 +7,6 @@
</Application.DataTemplates>
<Application.Styles>
<FluentTheme Mode="Light" />
<StyleInclude Source="avares://TemplatedDataGrid/DataGridCell.axaml"/>
<StyleInclude Source="avares://TemplatedDataGrid/DataGridRow.axaml"/>
<StyleInclude Source="avares://TemplatedDataGrid/DataGridColumnHeader.axaml"/>
<StyleInclude Source="avares://TemplatedDataGrid/DataGridColumnHeadersPresenter.axaml"/>
<StyleInclude Source="avares://TemplatedDataGrid/DataGridRowsPresenter.axaml"/>
<StyleInclude Source="avares://TemplatedDataGrid/DataGrid.axaml"/>
<StyleInclude Source="avares://TemplatedDataGrid/Themes/Fluent.axaml"/>
</Application.Styles>
</Application>

Просмотреть файл

@ -53,7 +53,7 @@
</g:DataGridTemplateColumn.CellTemplate>
</g:DataGridTemplateColumn>
<!-- Column4 -->
<!--
<g:DataGridTemplateColumn Header="Column4" Width="100">
<g:DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="vm:ItemViewModel">
@ -61,9 +61,9 @@
</DataTemplate>
</g:DataGridTemplateColumn.CellTemplate>
</g:DataGridTemplateColumn>
-->
<!-- Column5 -->
<!--
<g:DataGridTemplateColumn Header="Column5" Width="100">
<g:DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="vm:ItemViewModel">
@ -71,7 +71,7 @@
</DataTemplate>
</g:DataGridTemplateColumn.CellTemplate>
</g:DataGridTemplateColumn>
-->
</g:DataGrid.Columns>
</g:DataGrid>