3 changed files with 364 additions and 296 deletions
@ -1,305 +1,377 @@ |
|||||
<Styles xmlns="https://github.com/avaloniaui" |
<Styles xmlns="https://github.com/avaloniaui" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
||||
<!--TODO: Validation and Focus--> |
|
||||
|
|
||||
<Styles.Resources> |
<Styles.Resources> |
||||
<Thickness x:Key="DataGridTextColumnCellTextBlockMargin">4</Thickness> |
<Thickness x:Key="DataGridTextColumnCellTextBlockMargin">4</Thickness> |
||||
</Styles.Resources> |
<ControlTheme x:Key="DataGridCellTextBlockTheme" |
||||
|
TargetType="TextBlock"> |
||||
<Style Selector="DataGridCell"> |
<Setter Property="Margin" Value="{DynamicResource DataGridTextColumnCellTextBlockMargin}" /> |
||||
<Setter Property="Background" Value="Transparent"/> |
<Setter Property="VerticalAlignment" Value="Center" /> |
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
</ControlTheme> |
||||
<Setter Property="VerticalContentAlignment" Value="Stretch" /> |
<ControlTheme x:Key="DataGridCellTextBoxTheme" |
||||
<Setter Property="Template"> |
BasedOn="{StaticResource {x:Type TextBox}}" |
||||
<ControlTemplate> |
TargetType="TextBox"> |
||||
<Border x:Name="CellBorder" |
<Setter Property="VerticalAlignment" Value="Stretch" /> |
||||
Background="{TemplateBinding Background}" |
<Setter Property="Background" Value="Transparent" /> |
||||
BorderBrush="{TemplateBinding BorderBrush}" |
</ControlTheme> |
||||
BorderThickness="{TemplateBinding BorderThickness}" |
|
||||
CornerRadius="{TemplateBinding CornerRadius}"> |
<ControlTheme x:Key="{x:Type DataGridCell}" |
||||
<Grid ColumnDefinitions="*,Auto"> |
TargetType="DataGridCell"> |
||||
<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" |
<Setter Property="Background" Value="Transparent" /> |
||||
Content="{TemplateBinding Content}" |
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
||||
Margin="{TemplateBinding Padding}" |
<Setter Property="VerticalContentAlignment" Value="Stretch" /> |
||||
Foreground="{TemplateBinding Foreground}" |
<Setter Property="Template"> |
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
<ControlTemplate> |
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
<Border x:Name="CellBorder" |
||||
|
Background="{TemplateBinding Background}" |
||||
<Rectangle Name="PART_RightGridLine" |
BorderBrush="{TemplateBinding BorderBrush}" |
||||
Grid.Column="1" |
BorderThickness="{TemplateBinding BorderThickness}" |
||||
VerticalAlignment="Stretch" |
CornerRadius="{TemplateBinding CornerRadius}"> |
||||
Width="1" /> |
<Grid ColumnDefinitions="*,Auto"> |
||||
</Grid> |
<ContentPresenter Margin="{TemplateBinding Padding}" |
||||
</Border> |
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
||||
</ControlTemplate> |
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
||||
</Setter> |
Content="{TemplateBinding Content}" |
||||
</Style> |
ContentTemplate="{TemplateBinding ContentTemplate}" |
||||
<Style Selector="DataGridCell > TextBlock#CellTextBlock"> |
Foreground="{TemplateBinding Foreground}" /> |
||||
<Setter Property="Margin" Value="{DynamicResource DataGridTextColumnCellTextBlockMargin}" /> |
|
||||
<Setter Property="VerticalAlignment" Value="Center" /> |
<Rectangle Name="PART_RightGridLine" |
||||
</Style> |
Grid.Column="1" |
||||
|
Width="1" |
||||
<Style Selector="DataGridColumnHeader"> |
VerticalAlignment="Stretch" /> |
||||
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}" /> |
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|
||||
<Setter Property="SeparatorBrush" Value="{DynamicResource ThemeControlLowColor}" /> |
|
||||
<Setter Property="Padding" Value="4" /> |
|
||||
<Setter Property="Background" Value="{DynamicResource ThemeControlMidBrush}"/> |
|
||||
|
|
||||
<Setter Property="Template"> |
|
||||
<ControlTemplate> |
|
||||
<Border x:Name="HeaderBorder" |
|
||||
Background="{TemplateBinding Background}" |
|
||||
BorderBrush="{TemplateBinding BorderBrush}" |
|
||||
BorderThickness="{TemplateBinding BorderThickness}" |
|
||||
CornerRadius="{TemplateBinding CornerRadius}"> |
|
||||
<Grid ColumnDefinitions="*,Auto"> |
|
||||
|
|
||||
<Grid ColumnDefinitions="*,Auto" |
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|
||||
Margin="{TemplateBinding Padding}"> |
|
||||
<ContentPresenter Content="{TemplateBinding Content}" |
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
|
||||
|
|
||||
<Path Name="SortIcon" |
|
||||
Grid.Column="1" |
|
||||
Fill="{TemplateBinding Foreground}" |
|
||||
HorizontalAlignment="Left" |
|
||||
VerticalAlignment="Center" |
|
||||
Stretch="Uniform" |
|
||||
Width="8" |
|
||||
Margin="4,0,0,0" |
|
||||
Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z "/> |
|
||||
|
|
||||
</Grid> |
</Grid> |
||||
|
</Border> |
||||
|
</ControlTemplate> |
||||
|
</Setter> |
||||
|
</ControlTheme> |
||||
|
|
||||
|
<ControlTheme x:Key="{x:Type DataGridColumnHeader}" |
||||
|
TargetType="DataGridColumnHeader"> |
||||
|
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}" /> |
||||
|
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
||||
|
<Setter Property="VerticalContentAlignment" Value="Center" /> |
||||
|
<Setter Property="SeparatorBrush" Value="{DynamicResource ThemeControlLowColor}" /> |
||||
|
<Setter Property="Padding" Value="4" /> |
||||
|
<Setter Property="Background" Value="{DynamicResource ThemeControlMidBrush}" /> |
||||
|
<Setter Property="Template"> |
||||
|
<ControlTemplate> |
||||
|
<Border x:Name="HeaderBorder" |
||||
|
Background="{TemplateBinding Background}" |
||||
|
BorderBrush="{TemplateBinding BorderBrush}" |
||||
|
BorderThickness="{TemplateBinding BorderThickness}" |
||||
|
CornerRadius="{TemplateBinding CornerRadius}"> |
||||
|
<Grid ColumnDefinitions="*,Auto"> |
||||
|
|
||||
|
<Grid Margin="{TemplateBinding Padding}" |
||||
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
||||
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
||||
|
ColumnDefinitions="*,Auto"> |
||||
|
<ContentPresenter Content="{TemplateBinding Content}" |
||||
|
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
||||
|
|
||||
|
<Path Name="SortIcon" |
||||
|
Grid.Column="1" |
||||
|
Width="8" |
||||
|
Margin="4,0,0,0" |
||||
|
HorizontalAlignment="Left" |
||||
|
VerticalAlignment="Center" |
||||
|
Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z " |
||||
|
Fill="{TemplateBinding Foreground}" |
||||
|
IsVisible="False" |
||||
|
Stretch="Uniform" /> |
||||
|
|
||||
|
</Grid> |
||||
|
|
||||
|
<Rectangle Name="VerticalSeparator" |
||||
|
Grid.Column="1" |
||||
|
Width="1" |
||||
|
VerticalAlignment="Stretch" |
||||
|
Fill="{TemplateBinding SeparatorBrush}" |
||||
|
IsVisible="{TemplateBinding AreSeparatorsVisible}" /> |
||||
|
|
||||
<Rectangle Name="VerticalSeparator" |
</Grid> |
||||
Grid.Column="1" Width="1" |
</Border> |
||||
VerticalAlignment="Stretch" |
</ControlTemplate> |
||||
|
</Setter> |
||||
|
|
||||
|
<Style Selector="^:focus-visible /template/ Grid#FocusVisual"> |
||||
|
<Setter Property="IsVisible" Value="True" /> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="^:pointerover /template/ Grid#PART_ColumnHeaderRoot"> |
||||
|
<Setter Property="Background" Value="{DynamicResource DataGridColumnHeaderHoveredBackgroundBrush}" /> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="^:pressed /template/ Grid#PART_ColumnHeaderRoot"> |
||||
|
<Setter Property="Background" Value="{DynamicResource DataGridColumnHeaderPressedBackgroundBrush}" /> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="^:dragIndicator"> |
||||
|
<Setter Property="Opacity" Value="0.5" /> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="^:sortascending /template/ Path#SortIcon"> |
||||
|
<Setter Property="IsVisible" Value="True" /> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="^:sortdescending /template/ Path#SortIcon"> |
||||
|
<Setter Property="IsVisible" Value="True" /> |
||||
|
<Setter Property="RenderTransform"> |
||||
|
<Setter.Value> |
||||
|
<ScaleTransform ScaleX="1" ScaleY="-1" /> |
||||
|
</Setter.Value> |
||||
|
</Setter> |
||||
|
</Style> |
||||
|
</ControlTheme> |
||||
|
|
||||
|
<ControlTheme x:Key="{x:Type DataGridRowHeader}" |
||||
|
TargetType="DataGridRowHeader"> |
||||
|
<Setter Property="Focusable" Value="False" /> |
||||
|
<Setter Property="Template"> |
||||
|
<ControlTemplate> |
||||
|
<Grid x:Name="PART_Root" |
||||
|
ColumnDefinitions="Auto,*" |
||||
|
RowDefinitions="*,*,Auto"> |
||||
|
<Border Grid.RowSpan="3" |
||||
|
Grid.ColumnSpan="2" |
||||
|
BorderBrush="{TemplateBinding SeparatorBrush}" |
||||
|
BorderThickness="0,0,1,0"> |
||||
|
<Grid Background="{TemplateBinding Background}"> |
||||
|
<Rectangle x:Name="RowInvalidVisualElement" |
||||
|
Stretch="Fill" /> |
||||
|
<Rectangle x:Name="BackgroundRectangle" |
||||
|
Stretch="Fill" /> |
||||
|
</Grid> |
||||
|
</Border> |
||||
|
<Rectangle x:Name="HorizontalSeparator" |
||||
|
Grid.Row="2" |
||||
|
Grid.ColumnSpan="2" |
||||
|
Height="1" |
||||
|
Margin="1,0,1,0" |
||||
|
HorizontalAlignment="Stretch" |
||||
Fill="{TemplateBinding SeparatorBrush}" |
Fill="{TemplateBinding SeparatorBrush}" |
||||
IsVisible="{TemplateBinding AreSeparatorsVisible}" /> |
IsVisible="{TemplateBinding AreSeparatorsVisible}" /> |
||||
|
|
||||
|
<ContentPresenter Grid.RowSpan="2" |
||||
|
Grid.Column="1" |
||||
|
HorizontalAlignment="Center" |
||||
|
VerticalAlignment="Center" |
||||
|
Content="{TemplateBinding Content}" /> |
||||
</Grid> |
</Grid> |
||||
</Border> |
</ControlTemplate> |
||||
</ControlTemplate> |
</Setter> |
||||
</Setter> |
</ControlTheme> |
||||
</Style> |
|
||||
|
<ControlTheme x:Key="{x:Type DataGridRow}" |
||||
<Style Selector="DataGridColumnHeader:dragIndicator"> |
TargetType="DataGridRow"> |
||||
<Setter Property="Opacity" Value="0.5"/> |
<Setter Property="Background" Value="{Binding $parent[DataGrid].RowBackground}" /> |
||||
</Style> |
<Setter Property="Template"> |
||||
|
<ControlTemplate> |
||||
<Style Selector="DataGridColumnHeader /template/ Path#SortIcon"> |
<Border x:Name="RowBorder" |
||||
<Setter Property="IsVisible" Value="False"/> |
Background="{TemplateBinding Background}" |
||||
<Setter Property="RenderTransform"> |
BorderBrush="{TemplateBinding BorderBrush}" |
||||
<Setter.Value> |
BorderThickness="{TemplateBinding BorderThickness}" |
||||
<ScaleTransform ScaleX="0.9" ScaleY="0.9" /> |
CornerRadius="{TemplateBinding CornerRadius}"> |
||||
</Setter.Value> |
<DataGridFrozenGrid Name="PART_Root" |
||||
</Setter> |
ColumnDefinitions="Auto,*" |
||||
</Style> |
RowDefinitions="*,Auto,Auto"> |
||||
|
|
||||
<Style Selector="DataGridColumnHeader:sortascending /template/ Path#SortIcon"> |
<Rectangle Name="BackgroundRectangle" |
||||
<Setter Property="IsVisible" Value="True"/> |
Grid.RowSpan="2" |
||||
</Style> |
Grid.ColumnSpan="2" /> |
||||
|
|
||||
<Style Selector="DataGridColumnHeader:sortdescending /template/ Path#SortIcon"> |
<DataGridRowHeader Name="PART_RowHeader" |
||||
<Setter Property="IsVisible" Value="True"/> |
Grid.RowSpan="3" |
||||
<Setter Property="RenderTransform"> |
DataGridFrozenGrid.IsFrozen="True" /> |
||||
<Setter.Value> |
<DataGridCellsPresenter Name="PART_CellsPresenter" |
||||
<ScaleTransform ScaleX="0.9" ScaleY="-0.9" /> |
Grid.Column="1" |
||||
</Setter.Value> |
DataGridFrozenGrid.IsFrozen="True" /> |
||||
</Setter> |
<DataGridDetailsPresenter Name="PART_DetailsPresenter" |
||||
</Style> |
Grid.Row="1" |
||||
|
Grid.Column="1" /> |
||||
<Style Selector="DataGridRow"> |
<Rectangle Name="PART_BottomGridLine" |
||||
<Setter Property="Template"> |
Grid.Row="2" |
||||
<ControlTemplate> |
Grid.Column="1" |
||||
<Border x:Name="RowBorder" |
Height="1" |
||||
Background="{TemplateBinding Background}" |
HorizontalAlignment="Stretch" /> |
||||
BorderBrush="{TemplateBinding BorderBrush}" |
|
||||
BorderThickness="{TemplateBinding BorderThickness}" |
</DataGridFrozenGrid> |
||||
CornerRadius="{TemplateBinding CornerRadius}"> |
</Border> |
||||
<DataGridFrozenGrid Name="PART_Root" |
</ControlTemplate> |
||||
RowDefinitions="*,Auto,Auto" |
</Setter> |
||||
ColumnDefinitions="Auto,*"> |
|
||||
|
<Style Selector="^:nth-child(even)"> |
||||
<Rectangle Name="BackgroundRectangle" Grid.RowSpan="2" Grid.ColumnSpan="2"/> |
<Setter Property="Background" Value="{Binding $parent[DataGrid].AlternatingRowBackground}" /> |
||||
|
</Style> |
||||
<DataGridRowHeader Grid.RowSpan="3" Name="PART_RowHeader" DataGridFrozenGrid.IsFrozen="True" /> |
|
||||
<DataGridCellsPresenter Grid.Column="1" Name="PART_CellsPresenter" DataGridFrozenGrid.IsFrozen="True" /> |
<Style Selector="^ /template/ Rectangle#BackgroundRectangle"> |
||||
<DataGridDetailsPresenter Grid.Row="1" Grid.Column="1" Name="PART_DetailsPresenter"/> |
<Setter Property="IsVisible" Value="False" /> |
||||
<Rectangle Grid.Row="2" Grid.Column="1" Name="PART_BottomGridLine" HorizontalAlignment="Stretch" Height="1" /> |
<Setter Property="Fill" Value="{DynamicResource HighlightBrush}" /> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="^:pointerover /template/ Rectangle#BackgroundRectangle"> |
||||
|
<Setter Property="IsVisible" Value="True" /> |
||||
|
<Setter Property="Opacity" Value="0.5" /> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="^:selected /template/ Rectangle#BackgroundRectangle"> |
||||
|
<Setter Property="IsVisible" Value="True" /> |
||||
|
<Setter Property="Opacity" Value="1" /> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="^:selected"> |
||||
|
<Setter Property="Foreground" Value="{DynamicResource HighlightForegroundBrush}" /> |
||||
|
</Style> |
||||
|
</ControlTheme> |
||||
|
|
||||
|
<ControlTheme x:Key="DefaultDataGridRowGroupExpanderButtonTheme" |
||||
|
TargetType="ToggleButton"> |
||||
|
<Setter Property="Template"> |
||||
|
<ControlTemplate> |
||||
|
<Border Grid.Column="0" |
||||
|
Width="20" |
||||
|
Height="20" |
||||
|
HorizontalAlignment="Center" |
||||
|
VerticalAlignment="Center" |
||||
|
Background="Transparent"> |
||||
|
<Path HorizontalAlignment="Center" |
||||
|
VerticalAlignment="Center" |
||||
|
Data="M 0 2 L 4 6 L 0 10 Z" |
||||
|
Fill="{TemplateBinding Foreground}" /> |
||||
|
</Border> |
||||
|
</ControlTemplate> |
||||
|
</Setter> |
||||
|
<Style Selector="^:checked /template/ Path"> |
||||
|
<Setter Property="RenderTransform"> |
||||
|
<RotateTransform Angle="90" /> |
||||
|
</Setter> |
||||
|
</Style> |
||||
|
</ControlTheme> |
||||
|
|
||||
|
|
||||
|
<ControlTheme x:Key="{x:Type DataGridRowGroupHeader}" |
||||
|
TargetType="DataGridRowGroupHeader"> |
||||
|
<Setter Property="Background" Value="{DynamicResource ThemeControlMidHighBrush}" /> |
||||
|
<Setter Property="Height" Value="20" /> |
||||
|
<Setter Property="Template"> |
||||
|
<ControlTemplate> |
||||
|
<DataGridFrozenGrid Name="Root" |
||||
|
ColumnDefinitions="Auto,Auto,Auto,Auto" |
||||
|
RowDefinitions="Auto,*,Auto"> |
||||
|
|
||||
|
<Rectangle Name="IndentSpacer" |
||||
|
Grid.Row="1" |
||||
|
Grid.Column="1" /> |
||||
|
<ToggleButton Name="ExpanderButton" |
||||
|
Grid.Row="1" |
||||
|
Grid.Column="2" |
||||
|
Margin="2,0,0,0" |
||||
|
Background="{TemplateBinding Background}" |
||||
|
BorderBrush="{TemplateBinding BorderBrush}" |
||||
|
BorderThickness="{TemplateBinding BorderThickness}" |
||||
|
CornerRadius="{TemplateBinding CornerRadius}" |
||||
|
Foreground="{TemplateBinding Foreground}" |
||||
|
Theme="{StaticResource DefaultDataGridRowGroupExpanderButtonTheme}" /> |
||||
|
|
||||
|
<StackPanel Grid.Row="1" |
||||
|
Grid.Column="3" |
||||
|
Margin="0,1,0,1" |
||||
|
VerticalAlignment="Center" |
||||
|
Orientation="Horizontal"> |
||||
|
<TextBlock Name="PropertyNameElement" |
||||
|
Margin="4,0,0,0" |
||||
|
IsVisible="{TemplateBinding IsPropertyNameVisible}" /> |
||||
|
<TextBlock Margin="4,0,0,0" |
||||
|
Text="{Binding Key}" /> |
||||
|
<TextBlock Name="ItemCountElement" |
||||
|
Margin="4,0,0,0" |
||||
|
IsVisible="{TemplateBinding IsItemCountVisible}" /> |
||||
|
</StackPanel> |
||||
|
|
||||
|
<DataGridRowHeader Name="RowHeader" |
||||
|
Grid.RowSpan="3" |
||||
|
DataGridFrozenGrid.IsFrozen="True" /> |
||||
|
|
||||
</DataGridFrozenGrid> |
</DataGridFrozenGrid> |
||||
</Border> |
</ControlTemplate> |
||||
</ControlTemplate> |
</Setter> |
||||
</Setter> |
</ControlTheme> |
||||
</Style> |
|
||||
|
<ControlTheme x:Key="{x:Type DataGrid}" |
||||
<Style Selector="DataGridRow"> |
TargetType="DataGrid"> |
||||
<Setter Property="Background" Value="{Binding $parent[DataGrid].RowBackground}" /> |
<Setter Property="RowBackground" Value="{DynamicResource ThemeAccentBrush4}" /> |
||||
</Style> |
<Setter Property="AlternatingRowBackground" Value="#00FFFFFF" /> |
||||
<Style Selector="DataGridRow:nth-child(even)"> |
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" /> |
||||
<Setter Property="Background" Value="{Binding $parent[DataGrid].AlternatingRowBackground}" /> |
<Setter Property="HeadersVisibility" Value="Column" /> |
||||
</Style> |
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" /> |
||||
|
<Setter Property="VerticalScrollBarVisibility" Value="Auto" /> |
||||
<Style Selector="DataGridRow /template/ Rectangle#BackgroundRectangle"> |
<Setter Property="SelectionMode" Value="Extended" /> |
||||
<Setter Property="IsVisible" Value="False"/> |
<Setter Property="HorizontalGridLinesBrush" Value="{DynamicResource ThemeBorderHighColor}" /> |
||||
<Setter Property="Fill" Value="{DynamicResource HighlightBrush}" /> |
<Setter Property="VerticalGridLinesBrush" Value="{DynamicResource ThemeBorderHighColor}" /> |
||||
</Style> |
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderLowColor}" /> |
||||
|
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}" /> |
||||
<Style Selector="DataGridRow:pointerover /template/ Rectangle#BackgroundRectangle"> |
<Setter Property="DropLocationIndicatorTemplate"> |
||||
<Setter Property="IsVisible" Value="True"/> |
<Template> |
||||
<Setter Property="Opacity" Value="0.5"/> |
<Rectangle Width="2" |
||||
</Style> |
Fill="{DynamicResource ThemeBorderHighColor}" /> |
||||
|
</Template> |
||||
<Style Selector="DataGridRow:selected /template/ Rectangle#BackgroundRectangle"> |
</Setter> |
||||
<Setter Property="IsVisible" Value="True"/> |
<Setter Property="Template"> |
||||
<Setter Property="Opacity" Value="1"/> |
<ControlTemplate> |
||||
</Style> |
<Border x:Name="DataGridBorder" |
||||
|
Background="{TemplateBinding Background}" |
||||
<Style Selector="DataGridRow:selected"> |
BorderBrush="{TemplateBinding BorderBrush}" |
||||
<Setter Property="Foreground" Value="{DynamicResource HighlightForegroundBrush}" /> |
BorderThickness="{TemplateBinding BorderThickness}" |
||||
</Style> |
CornerRadius="{TemplateBinding CornerRadius}"> |
||||
|
<Grid ColumnDefinitions="Auto,*,Auto" |
||||
<Style Selector="DataGridRowHeader"> |
RowDefinitions="Auto,*,Auto,Auto"> |
||||
<Setter Property="Focusable" Value="False" /> |
<DataGridColumnHeader Name="PART_TopLeftCornerHeader" |
||||
<Setter Property="Template"> |
Width="22" /> |
||||
<ControlTemplate> |
<DataGridColumnHeadersPresenter Name="PART_ColumnHeadersPresenter" |
||||
<Grid x:Name="PART_Root" |
Grid.Column="1" /> |
||||
RowDefinitions="*,*,Auto" |
<DataGridColumnHeader Name="PART_TopRightCornerHeader" |
||||
ColumnDefinitions="Auto,*"> |
Grid.Column="2" /> |
||||
<Border Grid.RowSpan="3" |
<Rectangle Name="PART_ColumnHeadersAndRowsSeparator" |
||||
Grid.ColumnSpan="2" |
Grid.ColumnSpan="3" |
||||
BorderBrush="{TemplateBinding SeparatorBrush}" |
Height="1" |
||||
BorderThickness="0,0,1,0"> |
VerticalAlignment="Bottom" |
||||
<Grid Background="{TemplateBinding Background}"> |
Fill="{DynamicResource ThemeControlMidHighBrush}" |
||||
<Rectangle x:Name="RowInvalidVisualElement" |
StrokeThickness="1" /> |
||||
Stretch="Fill" /> |
|
||||
<Rectangle x:Name="BackgroundRectangle" |
<DataGridRowsPresenter Name="PART_RowsPresenter" |
||||
Stretch="Fill" /> |
Grid.Row="1" |
||||
|
Grid.ColumnSpan="2"> |
||||
|
<DataGridRowsPresenter.GestureRecognizers> |
||||
|
<ScrollGestureRecognizer CanHorizontallyScroll="True" |
||||
|
CanVerticallyScroll="True" /> |
||||
|
</DataGridRowsPresenter.GestureRecognizers> |
||||
|
</DataGridRowsPresenter> |
||||
|
<Rectangle Name="PART_BottomRightCorner" |
||||
|
Grid.Row="2" |
||||
|
Grid.Column="2" |
||||
|
Fill="{DynamicResource ThemeControlMidHighBrush}" /> |
||||
|
<Rectangle Name="BottomLeftCorner" |
||||
|
Grid.Row="2" |
||||
|
Grid.ColumnSpan="2" |
||||
|
Fill="{DynamicResource ThemeControlMidHighBrush}" /> |
||||
|
<ScrollBar Name="PART_VerticalScrollbar" |
||||
|
Grid.Row="1" |
||||
|
Grid.Column="2" |
||||
|
Width="{DynamicResource ScrollBarThickness}" |
||||
|
Orientation="Vertical" /> |
||||
|
|
||||
|
<Grid Grid.Row="2" |
||||
|
Grid.Column="1" |
||||
|
ColumnDefinitions="Auto,*"> |
||||
|
<Rectangle Name="PART_FrozenColumnScrollBarSpacer" /> |
||||
|
<ScrollBar Name="PART_HorizontalScrollbar" |
||||
|
Grid.Column="1" |
||||
|
Height="{DynamicResource ScrollBarThickness}" |
||||
|
Orientation="Horizontal" /> |
||||
|
</Grid> |
||||
</Grid> |
</Grid> |
||||
</Border> |
</Border> |
||||
<Rectangle x:Name="HorizontalSeparator" |
</ControlTemplate> |
||||
Grid.Row="2" |
</Setter> |
||||
Grid.ColumnSpan="2" |
</ControlTheme> |
||||
Height="1" |
</Styles.Resources> |
||||
Margin="1,0,1,0" |
|
||||
HorizontalAlignment="Stretch" |
|
||||
Fill="{TemplateBinding SeparatorBrush}" |
|
||||
IsVisible="{TemplateBinding AreSeparatorsVisible}" /> |
|
||||
|
|
||||
<ContentPresenter Grid.RowSpan="2" |
|
||||
Grid.Column="1" |
|
||||
HorizontalAlignment="Center" |
|
||||
VerticalAlignment="Center" |
|
||||
Content="{TemplateBinding Content}" /> |
|
||||
</Grid> |
|
||||
</ControlTemplate> |
|
||||
</Setter> |
|
||||
</Style> |
|
||||
|
|
||||
<Style Selector="DataGridRowGroupHeader"> |
|
||||
<Setter Property="Background" Value="{DynamicResource ThemeControlMidHighBrush}" /> |
|
||||
<Setter Property="Height" Value="20"/> |
|
||||
<Setter Property="Template"> |
|
||||
<ControlTemplate> |
|
||||
<DataGridFrozenGrid Name="Root" |
|
||||
ColumnDefinitions="Auto,Auto,Auto,Auto" |
|
||||
RowDefinitions="Auto,*,Auto"> |
|
||||
|
|
||||
<Rectangle Grid.Column="1" Grid.Row="1" Name="IndentSpacer" /> |
|
||||
<ToggleButton Grid.Column="2" Grid.Row="1" |
|
||||
Name="ExpanderButton" |
|
||||
Margin="2,0,0,0" |
|
||||
BorderBrush="{TemplateBinding BorderBrush}" |
|
||||
BorderThickness="{TemplateBinding BorderThickness}" |
|
||||
Background="{TemplateBinding Background}" |
|
||||
CornerRadius="{TemplateBinding CornerRadius}" |
|
||||
Foreground="{TemplateBinding Foreground}" /> |
|
||||
|
|
||||
<StackPanel Grid.Column="3" Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,1,0,1"> |
|
||||
<TextBlock Name="PropertyNameElement" Margin="4,0,0,0" IsVisible="{TemplateBinding IsPropertyNameVisible}"/> |
|
||||
<TextBlock Margin="4,0,0,0" Text="{Binding Key}" /> |
|
||||
<TextBlock Name="ItemCountElement" Margin="4,0,0,0" IsVisible="{TemplateBinding IsItemCountVisible}"/> |
|
||||
</StackPanel> |
|
||||
|
|
||||
<DataGridRowHeader Name="RowHeader" Grid.RowSpan="3" DataGridFrozenGrid.IsFrozen="True"/> |
|
||||
|
|
||||
</DataGridFrozenGrid> |
|
||||
</ControlTemplate> |
|
||||
</Setter> |
|
||||
</Style> |
|
||||
|
|
||||
<Style Selector="DataGridRowGroupHeader /template/ ToggleButton#ExpanderButton"> |
|
||||
<Setter Property="Template"> |
|
||||
<ControlTemplate> |
|
||||
<Border Grid.Column="0" Width="20" Height="20" Background="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center"> |
|
||||
<Path Fill="{TemplateBinding Foreground}" |
|
||||
HorizontalAlignment="Center" |
|
||||
VerticalAlignment="Center" |
|
||||
Data="M 0 2 L 4 6 L 0 10 Z" /> |
|
||||
</Border> |
|
||||
</ControlTemplate> |
|
||||
</Setter> |
|
||||
</Style> |
|
||||
|
|
||||
<Style Selector="DataGridRowGroupHeader /template/ ToggleButton#ExpanderButton:checked /template/ Path"> |
|
||||
<Setter Property="RenderTransform"> |
|
||||
<RotateTransform Angle="90" /> |
|
||||
</Setter> |
|
||||
</Style> |
|
||||
|
|
||||
<Style Selector="DataGrid"> |
|
||||
<Setter Property="RowBackground" Value="{DynamicResource ThemeAccentBrush4}" /> |
|
||||
<Setter Property="AlternatingRowBackground" Value="#00FFFFFF" /> |
|
||||
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" /> |
|
||||
<Setter Property="HeadersVisibility" Value="Column" /> |
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" /> |
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Auto" /> |
|
||||
<Setter Property="SelectionMode" Value="Extended" /> |
|
||||
<Setter Property="HorizontalGridLinesBrush" Value="{DynamicResource ThemeBorderHighColor}" /> |
|
||||
<Setter Property="VerticalGridLinesBrush" Value="{DynamicResource ThemeBorderHighColor}" /> |
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderLowColor}"/> |
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}" /> |
|
||||
<Setter Property="DropLocationIndicatorTemplate"> |
|
||||
<Template> |
|
||||
<Rectangle Fill="{DynamicResource ThemeBorderHighColor}" Width="2"/> |
|
||||
</Template> |
|
||||
</Setter> |
|
||||
<Setter Property="Template"> |
|
||||
<ControlTemplate> |
|
||||
<Border x:Name="DataGridBorder" |
|
||||
Background="{TemplateBinding Background}" |
|
||||
BorderBrush="{TemplateBinding BorderBrush}" |
|
||||
BorderThickness="{TemplateBinding BorderThickness}" |
|
||||
CornerRadius="{TemplateBinding CornerRadius}"> |
|
||||
<Grid RowDefinitions="Auto,*,Auto,Auto" ColumnDefinitions="Auto,*,Auto"> |
|
||||
|
|
||||
<DataGridColumnHeader Name="PART_TopLeftCornerHeader" Width="22" /> |
|
||||
<DataGridColumnHeadersPresenter Name="PART_ColumnHeadersPresenter" Grid.Column="1"/> |
|
||||
<DataGridColumnHeader Name="PART_TopRightCornerHeader" Grid.Column="2"/> |
|
||||
<Rectangle Name="PART_ColumnHeadersAndRowsSeparator" Grid.ColumnSpan="3" VerticalAlignment="Bottom" StrokeThickness="1" Height="1" Fill="{DynamicResource ThemeControlMidHighBrush}"/> |
|
||||
|
|
||||
<DataGridRowsPresenter Name="PART_RowsPresenter" Grid.ColumnSpan="2" Grid.Row="1"> |
|
||||
<DataGridRowsPresenter.GestureRecognizers> |
|
||||
<ScrollGestureRecognizer CanHorizontallyScroll="True" CanVerticallyScroll="True" /> |
|
||||
</DataGridRowsPresenter.GestureRecognizers> |
|
||||
</DataGridRowsPresenter> |
|
||||
<Rectangle Name="PART_BottomRightCorner" Fill="{DynamicResource ThemeControlMidHighBrush}" Grid.Column="2" Grid.Row="2" /> |
|
||||
<Rectangle Name="BottomLeftCorner" Fill="{DynamicResource ThemeControlMidHighBrush}" Grid.Row="2" Grid.ColumnSpan="2" /> |
|
||||
<ScrollBar Name="PART_VerticalScrollbar" Orientation="Vertical" Grid.Column="2" Grid.Row="1" Width="{DynamicResource ScrollBarThickness}"/> |
|
||||
|
|
||||
<Grid Grid.Column="1" Grid.Row="2" |
|
||||
ColumnDefinitions="Auto,*"> |
|
||||
<Rectangle Name="PART_FrozenColumnScrollBarSpacer" /> |
|
||||
<ScrollBar Name="PART_HorizontalScrollbar" Grid.Column="1" Orientation="Horizontal" Height="{DynamicResource ScrollBarThickness}"/> |
|
||||
</Grid> |
|
||||
</Grid> |
|
||||
</Border> |
|
||||
</ControlTemplate> |
|
||||
</Setter> |
|
||||
</Style> |
|
||||
</Styles> |
</Styles> |
||||
|
|||||
Loading…
Reference in new issue