26 changed files with 767 additions and 914 deletions
@ -0,0 +1,77 @@ |
|||
<ControlTheme xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:Class="Avalonia.Controls.Themes.DataGridCellTheme" |
|||
TargetType="DataGridCell"> |
|||
<Setter Property="Background" Value="{DynamicResource DataGridCellBackgroundBrush}" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Stretch" /> |
|||
<Setter Property="FontSize" Value="15" /> |
|||
<Setter Property="MinHeight" Value="32" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border x:Name="CellBorder" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Grid x:Name="PART_CellRoot" ColumnDefinitions="*,Auto"> |
|||
|
|||
<Rectangle x:Name="CurrencyVisual" |
|||
IsVisible="False" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
Fill="Transparent" |
|||
IsHitTestVisible="False" |
|||
Stroke="{DynamicResource DataGridCurrencyVisualPrimaryBrush}" |
|||
StrokeThickness="1" /> |
|||
<Grid Grid.Column="0" x:Name="FocusVisual" IsHitTestVisible="False" |
|||
IsVisible="False"> |
|||
<Rectangle HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
Fill="Transparent" |
|||
IsHitTestVisible="False" |
|||
Stroke="{DynamicResource DataGridCellFocusVisualPrimaryBrush}" |
|||
StrokeThickness="2" /> |
|||
<Rectangle Margin="2" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
Fill="Transparent" |
|||
IsHitTestVisible="False" |
|||
Stroke="{DynamicResource DataGridCellFocusVisualSecondaryBrush}" |
|||
StrokeThickness="1" /> |
|||
</Grid> |
|||
|
|||
<ContentPresenter Grid.Column="0" Margin="{TemplateBinding Padding}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Foreground="{TemplateBinding Foreground}" /> |
|||
|
|||
<Rectangle Grid.Column="0" x:Name="InvalidVisualElement" |
|||
IsVisible="False" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
IsHitTestVisible="False" |
|||
Stroke="{DynamicResource DataGridCellInvalidBrush}" |
|||
StrokeThickness="1" /> |
|||
|
|||
<Rectangle Name="PART_RightGridLine" |
|||
Grid.Column="1" |
|||
Width="1" |
|||
VerticalAlignment="Stretch" |
|||
Fill="{DynamicResource DataGridFillerColumnGridLinesBrush}" /> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Style Selector="^:current /template/ Rectangle#CurrencyVisual"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
<Style Selector="^:focus /template/ Grid#FocusVisual"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
<Style Selector="^:invalid /template/ Rectangle#InvalidVisualElement"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
@ -0,0 +1,12 @@ |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Markup.Xaml; |
|||
using Avalonia.Styling; |
|||
|
|||
namespace Avalonia.Controls.Themes; |
|||
|
|||
internal partial class DataGridCellTheme : ControlTheme |
|||
{ |
|||
public static DataGridCellTheme Instance { get; } = new(); |
|||
} |
|||
|
|||
@ -0,0 +1,103 @@ |
|||
<ControlTheme xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
TargetType="DataGridColumnHeader" |
|||
x:Class="Avalonia.Controls.Themes.DataGridColumnHeaderTheme"> |
|||
<ControlTheme.Resources> |
|||
<StreamGeometry x:Key="DataGridSortIconDescendingPath">M1875 1011l-787 787v-1798h-128v1798l-787 -787l-90 90l941 941l941 -941z</StreamGeometry> |
|||
<StreamGeometry x:Key="DataGridSortIconAscendingPath">M1965 947l-941 -941l-941 941l90 90l787 -787v1798h128v-1798l787 787z</StreamGeometry> |
|||
</ControlTheme.Resources> |
|||
|
|||
<Setter Property="Foreground" Value="{DynamicResource DataGridColumnHeaderForegroundBrush}" /> |
|||
<Setter Property="Background" Value="{DynamicResource DataGridColumnHeaderBackgroundBrush}" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="SeparatorBrush" Value="{DynamicResource DataGridGridLinesBrush}" /> |
|||
<Setter Property="Padding" Value="12,0,0,0" /> |
|||
<Setter Property="FontSize" Value="12" /> |
|||
<Setter Property="MinHeight" Value="32" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border x:Name="HeaderBorder" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Grid Name="PART_ColumnHeaderRoot" ColumnDefinitions="*,Auto"> |
|||
|
|||
<Grid Margin="{TemplateBinding Padding}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="Auto" MinWidth="32" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<ContentPresenter Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
|||
|
|||
<Path Name="SortIcon" |
|||
IsVisible="False" |
|||
Grid.Column="1" |
|||
Height="12" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
Fill="{TemplateBinding Foreground}" |
|||
Stretch="Uniform" /> |
|||
</Grid> |
|||
|
|||
<Rectangle Name="VerticalSeparator" |
|||
Grid.Column="1" |
|||
Width="1" |
|||
VerticalAlignment="Stretch" |
|||
Fill="{TemplateBinding SeparatorBrush}" |
|||
IsVisible="{TemplateBinding AreSeparatorsVisible}" /> |
|||
|
|||
<Grid x:Name="FocusVisual" IsHitTestVisible="False" |
|||
IsVisible="False"> |
|||
<Rectangle x:Name="FocusVisualPrimary" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
Fill="Transparent" |
|||
IsHitTestVisible="False" |
|||
Stroke="{DynamicResource DataGridCellFocusVisualPrimaryBrush}" |
|||
StrokeThickness="2" /> |
|||
<Rectangle x:Name="FocusVisualSecondary" |
|||
Margin="2" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
Fill="Transparent" |
|||
IsHitTestVisible="False" |
|||
Stroke="{DynamicResource DataGridCellFocusVisualSecondaryBrush}" |
|||
StrokeThickness="1" /> |
|||
</Grid> |
|||
</Grid> |
|||
</Border> |
|||
</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" /> |
|||
<Setter Property="Data" Value="{StaticResource DataGridSortIconAscendingPath}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:sortdescending /template/ Path#SortIcon"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
<Setter Property="Data" Value="{StaticResource DataGridSortIconDescendingPath}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
@ -0,0 +1,12 @@ |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Markup.Xaml; |
|||
using Avalonia.Styling; |
|||
|
|||
namespace Avalonia.Controls.Themes; |
|||
|
|||
internal partial class DataGridColumnHeaderTheme : ControlTheme |
|||
{ |
|||
public static DataGridColumnHeaderTheme Instance { get; } = new(); |
|||
} |
|||
|
|||
@ -0,0 +1,22 @@ |
|||
<ControlTheme xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:themes="clr-namespace:Avalonia.Controls.Themes" |
|||
TargetType="DataGridColumnHeader" |
|||
x:Class="Avalonia.Controls.Themes.DataGridLeftColumnHeaderTheme" |
|||
BasedOn="{x:Static themes:DataGridColumnHeaderTheme.Instance}"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid x:Name="TopLeftHeaderRoot" |
|||
RowDefinitions="*,*,Auto"> |
|||
<Border Grid.RowSpan="2" |
|||
BorderThickness="0,0,1,0" |
|||
BorderBrush="{DynamicResource DataGridGridLinesBrush}" /> |
|||
<Rectangle Grid.Row="0" Grid.RowSpan="2" |
|||
VerticalAlignment="Bottom" |
|||
StrokeThickness="1" |
|||
Height="1" |
|||
Fill="{DynamicResource DataGridGridLinesBrush}" /> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
@ -0,0 +1,12 @@ |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Markup.Xaml; |
|||
using Avalonia.Styling; |
|||
|
|||
namespace Avalonia.Controls.Themes; |
|||
|
|||
internal partial class DataGridLeftColumnHeaderTheme : ControlTheme |
|||
{ |
|||
public static DataGridLeftColumnHeaderTheme Instance { get; } = new(); |
|||
} |
|||
|
|||
@ -0,0 +1,28 @@ |
|||
<ControlTheme xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
TargetType="ToggleButton" |
|||
x:Class="Avalonia.Controls.Themes.DataGridRowGroupExpanderButtonTheme"> |
|||
<ControlTheme.Resources> |
|||
<StreamGeometry x:Key="DataGridRowGroupHeaderIconClosedPath">M515 93l930 931l-930 931l90 90l1022 -1021l-1022 -1021z</StreamGeometry> |
|||
<StreamGeometry x:Key="DataGridRowGroupHeaderIconOpenedPath">M109 486 19 576 1024 1581 2029 576 1939 486 1024 1401z</StreamGeometry> |
|||
</ControlTheme.Resources> |
|||
|
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Width="12" |
|||
Height="12" |
|||
Background="Transparent" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center"> |
|||
<Path Fill="{TemplateBinding Foreground}" |
|||
Data="{StaticResource DataGridRowGroupHeaderIconClosedPath}" |
|||
HorizontalAlignment="Right" |
|||
VerticalAlignment="Center" |
|||
Stretch="Uniform" /> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Style Selector="^:checked /template/ Path"> |
|||
<Setter Property="Data" Value="{StaticResource DataGridRowGroupHeaderIconOpenedPath}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
@ -0,0 +1,12 @@ |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Markup.Xaml; |
|||
using Avalonia.Styling; |
|||
|
|||
namespace Avalonia.Controls.Themes; |
|||
|
|||
internal partial class DataGridRowGroupExpanderButtonTheme : ControlTheme |
|||
{ |
|||
public static DataGridRowGroupExpanderButtonTheme Instance { get; } = new(); |
|||
} |
|||
|
|||
@ -0,0 +1,90 @@ |
|||
<ControlTheme xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:collections="clr-namespace:Avalonia.Collections" |
|||
xmlns:themes="clr-namespace:Avalonia.Controls.Themes" |
|||
TargetType="DataGridRowGroupHeader" |
|||
x:Class="Avalonia.Controls.Themes.DataGridRowGroupHeaderTheme"> |
|||
<Setter Property="Foreground" Value="{DynamicResource DataGridRowGroupHeaderForegroundBrush}" /> |
|||
<Setter Property="Background" Value="{DynamicResource DataGridRowGroupHeaderBackgroundBrush}" /> |
|||
<Setter Property="FontSize" Value="15" /> |
|||
<Setter Property="MinHeight" Value="32" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate x:DataType="collections:DataGridCollectionViewGroup"> |
|||
<DataGridFrozenGrid Name="PART_Root" |
|||
Background="{TemplateBinding Background}" |
|||
MinHeight="{TemplateBinding MinHeight}" |
|||
ColumnDefinitions="Auto,Auto,Auto,Auto,*" |
|||
RowDefinitions="*,Auto"> |
|||
|
|||
<Rectangle Name="PART_IndentSpacer" |
|||
Grid.Column="1" /> |
|||
<ToggleButton Name="PART_ExpanderButton" |
|||
Grid.Column="2" |
|||
Width="12" |
|||
Height="12" |
|||
Margin="12,0,0,0" |
|||
Theme="{x:Static themes:DataGridRowGroupExpanderButtonTheme.Instance}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Background="{TemplateBinding Background}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
IsTabStop="False" |
|||
Foreground="{TemplateBinding Foreground}" /> |
|||
|
|||
<StackPanel Grid.Column="3" |
|||
Orientation="Horizontal" |
|||
VerticalAlignment="Center" |
|||
Margin="12,0,0,0"> |
|||
<TextBlock Name="PART_PropertyNameElement" |
|||
Margin="4,0,0,0" |
|||
IsVisible="{TemplateBinding IsPropertyNameVisible}" |
|||
Foreground="{TemplateBinding Foreground}" /> |
|||
<TextBlock Margin="4,0,0,0" |
|||
Text="{Binding Key}" |
|||
Foreground="{TemplateBinding Foreground}" /> |
|||
<TextBlock Name="PART_ItemCountElement" |
|||
Margin="4,0,0,0" |
|||
IsVisible="{TemplateBinding IsItemCountVisible}" |
|||
Foreground="{TemplateBinding Foreground}" /> |
|||
</StackPanel> |
|||
|
|||
<Rectangle x:Name="CurrencyVisual" |
|||
Grid.ColumnSpan="5" |
|||
IsVisible="False" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
Fill="Transparent" |
|||
IsHitTestVisible="False" |
|||
Stroke="{DynamicResource DataGridCurrencyVisualPrimaryBrush}" |
|||
StrokeThickness="1" /> |
|||
<Grid x:Name="FocusVisual" |
|||
Grid.ColumnSpan="5" |
|||
IsVisible="False" |
|||
IsHitTestVisible="False"> |
|||
<Rectangle HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
Fill="Transparent" |
|||
IsHitTestVisible="False" |
|||
Stroke="{DynamicResource DataGridCellFocusVisualPrimaryBrush}" |
|||
StrokeThickness="2" /> |
|||
<Rectangle Margin="2" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
Fill="Transparent" |
|||
IsHitTestVisible="False" |
|||
Stroke="{DynamicResource DataGridCellFocusVisualSecondaryBrush}" |
|||
StrokeThickness="1" /> |
|||
</Grid> |
|||
|
|||
<DataGridRowHeader Name="PART_RowHeader" |
|||
Grid.RowSpan="2" |
|||
DataGridFrozenGrid.IsFrozen="True" /> |
|||
|
|||
<Rectangle x:Name="PART_BottomGridLine" |
|||
Grid.Row="1" |
|||
Grid.ColumnSpan="5" |
|||
Height="1" /> |
|||
</DataGridFrozenGrid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
@ -0,0 +1,12 @@ |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Markup.Xaml; |
|||
using Avalonia.Styling; |
|||
|
|||
namespace Avalonia.Controls.Themes; |
|||
|
|||
internal partial class DataGridRowGroupHeaderTheme : ControlTheme |
|||
{ |
|||
public static DataGridRowGroupHeaderTheme Instance { get; } = new(); |
|||
} |
|||
|
|||
@ -0,0 +1,43 @@ |
|||
<ControlTheme xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
TargetType="DataGridRowHeader" |
|||
x:Class="Avalonia.Controls.Themes.DataGridRowHeaderTheme"> |
|||
<Setter Property="SeparatorBrush" Value="{DynamicResource DataGridGridLinesBrush}" /> |
|||
<Setter Property="AreSeparatorsVisible" Value="False" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid x:Name="PART_Root" |
|||
RowDefinitions="*,*,Auto" |
|||
ColumnDefinitions="Auto,*"> |
|||
<Border Grid.RowSpan="3" |
|||
Grid.ColumnSpan="2" |
|||
BorderBrush="{TemplateBinding SeparatorBrush}" |
|||
BorderThickness="0,0,1,0"> |
|||
<Grid Background="{TemplateBinding Background}"> |
|||
<Rectangle x:Name="RowInvalidVisualElement" |
|||
Opacity="0" |
|||
Fill="{DynamicResource DataGridRowInvalidBrush}" |
|||
Stretch="Fill" /> |
|||
<Rectangle x:Name="BackgroundRectangle" |
|||
Fill="{DynamicResource DataGridRowBackgroundBrush}" |
|||
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}" |
|||
IsVisible="{TemplateBinding AreSeparatorsVisible}" /> |
|||
|
|||
<ContentPresenter Grid.RowSpan="2" |
|||
Grid.Column="1" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
Content="{TemplateBinding Content}" /> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
@ -0,0 +1,12 @@ |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Markup.Xaml; |
|||
using Avalonia.Styling; |
|||
|
|||
namespace Avalonia.Controls.Themes; |
|||
|
|||
internal partial class DataGridRowHeaderTheme : ControlTheme |
|||
{ |
|||
public static DataGridRowHeaderTheme Instance { get; } = new(); |
|||
} |
|||
|
|||
@ -0,0 +1,78 @@ |
|||
<ControlTheme xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
TargetType="DataGridRow" |
|||
x:Class="Avalonia.Controls.Themes.DataGridRowTheme"> |
|||
<Setter Property="Background" Value="{Binding $parent[DataGrid].RowBackground}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border x:Name="RowBorder" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<DataGridFrozenGrid Name="PART_Root" |
|||
ColumnDefinitions="Auto,*" |
|||
RowDefinitions="*,Auto,Auto"> |
|||
<Rectangle Name="BackgroundRectangle" |
|||
Grid.Row="0" Grid.Column="0" |
|||
Fill="{DynamicResource DataGridRowBackgroundBrush}" |
|||
Grid.RowSpan="2" |
|||
Grid.ColumnSpan="2" /> |
|||
<Rectangle x:Name="InvalidVisualElement" |
|||
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" |
|||
Opacity="0" |
|||
Fill="{DynamicResource DataGridRowInvalidBrush}" /> |
|||
|
|||
<DataGridRowHeader Name="PART_RowHeader" |
|||
Grid.RowSpan="3" Grid.Row="0" Grid.Column="0" |
|||
DataGridFrozenGrid.IsFrozen="True" /> |
|||
<DataGridCellsPresenter Name="PART_CellsPresenter" |
|||
Grid.Column="1" Grid.Row="0" |
|||
DataGridFrozenGrid.IsFrozen="True" /> |
|||
<DataGridDetailsPresenter Name="PART_DetailsPresenter" |
|||
Grid.Row="1" |
|||
Grid.Column="1" |
|||
Background="{DynamicResource DataGridDetailsPresenterBackgroundBrush}" /> |
|||
<Rectangle Name="PART_BottomGridLine" |
|||
Grid.Row="2" |
|||
Grid.Column="1" |
|||
Height="1" |
|||
HorizontalAlignment="Stretch" /> |
|||
|
|||
</DataGridFrozenGrid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:invalid"> |
|||
<Style Selector="^ /template/ Rectangle#InvalidVisualElement"> |
|||
<Setter Property="Opacity" Value="0.4" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Rectangle#BackgroundRectangle"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ Rectangle#BackgroundRectangle"> |
|||
<Setter Property="Opacity" Value="0.6" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:selected"> |
|||
<Style Selector="^ /template/ Rectangle#BackgroundRectangle"> |
|||
<Setter Property="Fill" Value="{DynamicResource DataGridRowSelectedUnfocusedBackgroundBrush}" /> |
|||
<Setter Property="Opacity" Value="{DynamicResource DataGridRowSelectedUnfocusedBackgroundOpacity}" /> |
|||
</Style> |
|||
<Style Selector="^:pointerover /template/ Rectangle#BackgroundRectangle"> |
|||
<Setter Property="Fill" Value="{DynamicResource DataGridRowSelectedHoveredUnfocusedBackgroundBrush}" /> |
|||
<Setter Property="Opacity" Value="{DynamicResource DataGridRowSelectedHoveredUnfocusedBackgroundOpacity}" /> |
|||
</Style> |
|||
<Style Selector="^:focus /template/ Rectangle#BackgroundRectangle"> |
|||
<Setter Property="Fill" Value="{DynamicResource DataGridRowSelectedBackgroundBrush}" /> |
|||
<Setter Property="Opacity" Value="{DynamicResource DataGridRowSelectedBackgroundOpacity}" /> |
|||
</Style> |
|||
<Style Selector="^:pointerover:focus /template/ Rectangle#BackgroundRectangle"> |
|||
<Setter Property="Fill" Value="{DynamicResource DataGridRowSelectedHoveredBackgroundBrush}" /> |
|||
<Setter Property="Opacity" Value="{DynamicResource DataGridRowSelectedHoveredBackgroundOpacity}" /> |
|||
</Style> |
|||
</Style> |
|||
</ControlTheme> |
|||
@ -0,0 +1,12 @@ |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Markup.Xaml; |
|||
using Avalonia.Styling; |
|||
|
|||
namespace Avalonia.Controls.Themes; |
|||
|
|||
internal partial class DataGridRowTheme : ControlTheme |
|||
{ |
|||
public static DataGridRowTheme Instance { get; } = new(); |
|||
} |
|||
|
|||
@ -0,0 +1,94 @@ |
|||
<ControlTheme xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:themes="clr-namespace:Avalonia.Controls.Themes" |
|||
TargetType="DataGrid" |
|||
x:Class="Avalonia.Controls.Themes.DataGridTheme"> |
|||
<Setter Property="RowBackground" Value="Transparent" /> |
|||
<Setter Property="HeadersVisibility" Value="Column" /> |
|||
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" /> |
|||
<Setter Property="VerticalScrollBarVisibility" Value="Auto" /> |
|||
<Setter Property="SelectionMode" Value="Extended" /> |
|||
<Setter Property="GridLinesVisibility" Value="None" /> |
|||
<Setter Property="HorizontalGridLinesBrush" Value="{DynamicResource DataGridGridLinesBrush}" /> |
|||
<Setter Property="VerticalGridLinesBrush" Value="{DynamicResource DataGridGridLinesBrush}" /> |
|||
<Setter Property="FocusAdorner" Value="{x:Null}" /> |
|||
<Setter Property="DropLocationIndicatorTemplate"> |
|||
<Template> |
|||
<Rectangle Fill="{DynamicResource DataGridDropLocationIndicatorBackground}" |
|||
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 ColumnDefinitions="Auto,*,Auto" |
|||
RowDefinitions="Auto,*,Auto,Auto" |
|||
ClipToBounds="True"> |
|||
<DataGridColumnHeader Name="PART_TopLeftCornerHeader" |
|||
Theme="{x:Static themes:DataGridLeftColumnHeaderTheme.Instance}" /> |
|||
<DataGridColumnHeadersPresenter Name="PART_ColumnHeadersPresenter" |
|||
Grid.Column="1" |
|||
Grid.Row="0" Grid.ColumnSpan="2" /> |
|||
<Rectangle Name="PART_ColumnHeadersAndRowsSeparator" |
|||
Grid.Row="0" Grid.ColumnSpan="3" Grid.Column="0" |
|||
VerticalAlignment="Bottom" |
|||
Height="1" |
|||
Fill="{DynamicResource DataGridGridLinesBrush}" /> |
|||
|
|||
<DataGridRowsPresenter Name="PART_RowsPresenter" |
|||
Grid.Row="1" |
|||
Grid.RowSpan="2" |
|||
Grid.ColumnSpan="3" Grid.Column="0"> |
|||
<DataGridRowsPresenter.GestureRecognizers> |
|||
<ScrollGestureRecognizer CanHorizontallyScroll="True" CanVerticallyScroll="True" /> |
|||
</DataGridRowsPresenter.GestureRecognizers> |
|||
</DataGridRowsPresenter> |
|||
<Rectangle Name="PART_BottomRightCorner" |
|||
Fill="{DynamicResource DataGridScrollBarsSeparatorBackground}" |
|||
Grid.Column="2" |
|||
Grid.Row="2" /> |
|||
<ScrollBar Name="PART_VerticalScrollbar" |
|||
Orientation="Vertical" |
|||
Grid.Column="2" |
|||
Grid.Row="1" |
|||
Width="{DynamicResource ScrollBarSize}" /> |
|||
|
|||
<Grid Grid.Column="1" |
|||
Grid.Row="2" |
|||
ColumnDefinitions="Auto,*"> |
|||
<Rectangle Name="PART_FrozenColumnScrollBarSpacer" /> |
|||
<ScrollBar Name="PART_HorizontalScrollbar" |
|||
Grid.Column="1" |
|||
Orientation="Horizontal" |
|||
Height="{DynamicResource ScrollBarSize}" /> |
|||
</Grid> |
|||
<Border x:Name="PART_DisabledVisualElement" |
|||
Grid.ColumnSpan="3" Grid.Column="0" |
|||
Grid.Row="0" Grid.RowSpan="4" |
|||
IsHitTestVisible="False" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
CornerRadius="2" |
|||
Background="{DynamicResource DataGridDisabledVisualElementBackground}" |
|||
IsVisible="{Binding !$parent[DataGrid].IsEnabled}" /> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:empty-columns"> |
|||
<Style Selector="^ /template/ DataGridColumnHeader#PART_TopLeftCornerHeader"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ DataGridColumnHeadersPresenter#PART_ColumnHeadersPresenter"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Rectangle#PART_ColumnHeadersAndRowsSeparator"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
</Style> |
|||
</ControlTheme> |
|||
@ -0,0 +1,12 @@ |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Markup.Xaml; |
|||
using Avalonia.Styling; |
|||
|
|||
namespace Avalonia.Controls.Themes; |
|||
|
|||
internal partial class DataGridTheme : ControlTheme |
|||
{ |
|||
public static DataGridTheme Instance { get; } = new(); |
|||
} |
|||
|
|||
@ -1,373 +1,67 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:collections="using:Avalonia.Collections"> |
|||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Styles.Resources> |
|||
<Thickness x:Key="DataGridTextColumnCellTextBlockMargin">4</Thickness> |
|||
<ControlTheme x:Key="DataGridCellTextBlockTheme" |
|||
TargetType="TextBlock"> |
|||
<Setter Property="Margin" Value="{DynamicResource DataGridTextColumnCellTextBlockMargin}" /> |
|||
<ResourceDictionary> |
|||
<ResourceDictionary.ThemeDictionaries> |
|||
<ResourceDictionary x:Key="Dark"> |
|||
<SolidColorBrush x:Key="DataGridColumnHeaderForegroundBrush" Color="{DynamicResource ThemeForegroundColor}" /> |
|||
<SolidColorBrush x:Key="DataGridColumnHeaderBackgroundBrush" Color="{DynamicResource ThemeControlMidColor}" /> |
|||
<SolidColorBrush x:Key="DataGridColumnHeaderHoveredBackgroundBrush" Color="{DynamicResource ThemeControlMidColor}" /> |
|||
<SolidColorBrush x:Key="DataGridColumnHeaderPressedBackgroundBrush" Color="{DynamicResource ThemeControlHighColor}" /> |
|||
<SolidColorBrush x:Key="DataGridColumnHeaderDraggedBackgroundBrush" Color="{DynamicResource ThemeControlHighColor}" /> |
|||
<SolidColorBrush x:Key="DataGridRowGroupHeaderBackgroundBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="DataGridRowGroupHeaderPressedBackgroundBrush" Color="{DynamicResource ThemeControlHighColor}" /> |
|||
<SolidColorBrush x:Key="DataGridRowGroupHeaderForegroundBrush" Color="{DynamicResource ThemeForegroundColor}" /> |
|||
<SolidColorBrush x:Key="DataGridRowGroupHeaderHoveredBackgroundBrush" Color="{DynamicResource ThemeControlMidColor}" /> |
|||
<SolidColorBrush x:Key="DataGridRowInvalidBrush" Color="{DynamicResource ErrorColor}" /> |
|||
<SolidColorBrush x:Key="DataGridCellFocusVisualPrimaryBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="DataGridCellFocusVisualSecondaryBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="DataGridCellInvalidBrush" Color="{DynamicResource ErrorColor}" /> |
|||
<SolidColorBrush x:Key="DataGridGridLinesBrush" Opacity="0.4" Color="{DynamicResource ThemeBorderHighColor}" /> |
|||
<SolidColorBrush x:Key="DataGridDetailsPresenterBackgroundBrush" Color="Transparent" /> |
|||
</ResourceDictionary> |
|||
<ResourceDictionary x:Key="Default"> |
|||
<SolidColorBrush x:Key="DataGridColumnHeaderForegroundBrush" Color="{DynamicResource ThemeForegroundColor}" /> |
|||
<SolidColorBrush x:Key="DataGridColumnHeaderBackgroundBrush" Color="{DynamicResource ThemeControlMidColor}" /> |
|||
<SolidColorBrush x:Key="DataGridColumnHeaderHoveredBackgroundBrush" Color="{DynamicResource ThemeControlMidColor}" /> |
|||
<SolidColorBrush x:Key="DataGridColumnHeaderPressedBackgroundBrush" Color="{DynamicResource ThemeControlHighColor}" /> |
|||
<SolidColorBrush x:Key="DataGridColumnHeaderDraggedBackgroundBrush" Color="{DynamicResource ThemeControlHighColor}" /> |
|||
<SolidColorBrush x:Key="DataGridRowGroupHeaderBackgroundBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="DataGridRowGroupHeaderPressedBackgroundBrush" Color="{DynamicResource ThemeControlHighColor}" /> |
|||
<SolidColorBrush x:Key="DataGridRowGroupHeaderForegroundBrush" Color="{DynamicResource ThemeForegroundColor}" /> |
|||
<SolidColorBrush x:Key="DataGridRowGroupHeaderHoveredBackgroundBrush" Color="{DynamicResource ThemeControlMidColor}" /> |
|||
<SolidColorBrush x:Key="DataGridRowInvalidBrush" Color="{DynamicResource ErrorColor}" /> |
|||
<SolidColorBrush x:Key="DataGridCellFocusVisualPrimaryBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="DataGridCellFocusVisualSecondaryBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="DataGridCellInvalidBrush" Color="{DynamicResource ErrorColor}" /> |
|||
<SolidColorBrush x:Key="DataGridGridLinesBrush" Opacity="0.4" Color="{DynamicResource ThemeBorderHighColor}" /> |
|||
<SolidColorBrush x:Key="DataGridDetailsPresenterBackgroundBrush" Color="Transparent" /> |
|||
</ResourceDictionary> |
|||
</ResourceDictionary.ThemeDictionaries> |
|||
|
|||
<x:Double x:Key="ListAccentLowOpacity">0.6</x:Double> |
|||
<x:Double x:Key="ListAccentMediumOpacity">0.8</x:Double> |
|||
|
|||
<SolidColorBrush x:Key="DataGridRowBackgroundBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="DataGridRowSelectedBackgroundBrush" Color="{DynamicResource HighlightColor}" /> |
|||
<StaticResource x:Key="DataGridRowSelectedBackgroundOpacity" ResourceKey="ListAccentLowOpacity" /> |
|||
<SolidColorBrush x:Key="DataGridRowSelectedHoveredBackgroundBrush" Color="{DynamicResource HighlightColor}" /> |
|||
<StaticResource x:Key="DataGridRowSelectedHoveredBackgroundOpacity" ResourceKey="ListAccentMediumOpacity" /> |
|||
<SolidColorBrush x:Key="DataGridRowSelectedUnfocusedBackgroundBrush" Color="{DynamicResource HighlightColor}" /> |
|||
<StaticResource x:Key="DataGridRowSelectedUnfocusedBackgroundOpacity" ResourceKey="ListAccentLowOpacity" /> |
|||
<SolidColorBrush x:Key="DataGridRowSelectedHoveredUnfocusedBackgroundBrush" Color="{DynamicResource HighlightColor}" /> |
|||
<StaticResource x:Key="DataGridRowSelectedHoveredUnfocusedBackgroundOpacity" ResourceKey="ListAccentMediumOpacity" /> |
|||
<SolidColorBrush x:Key="DataGridCellBackgroundBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="DataGridCurrencyVisualPrimaryBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="DataGridFillerColumnGridLinesBrush" Color="Transparent" /> |
|||
|
|||
<ControlTheme x:Key="DataGridCellTextBlockTheme" TargetType="TextBlock"> |
|||
<Setter Property="Margin" Value="4" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
</ControlTheme> |
|||
<ControlTheme x:Key="DataGridCellTextBoxTheme" |
|||
BasedOn="{StaticResource {x:Type TextBox}}" |
|||
TargetType="TextBox"> |
|||
<ControlTheme x:Key="DataGridCellTextBoxTheme" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}"> |
|||
<Setter Property="VerticalAlignment" Value="Stretch" /> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type DataGridCell}" |
|||
TargetType="DataGridCell"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Stretch" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border x:Name="CellBorder" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Grid ColumnDefinitions="*,Auto"> |
|||
<ContentPresenter Margin="{TemplateBinding Padding}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Foreground="{TemplateBinding Foreground}" /> |
|||
|
|||
<Rectangle Name="PART_RightGridLine" |
|||
Grid.Column="1" |
|||
Width="1" |
|||
VerticalAlignment="Stretch" /> |
|||
</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}" /> |
|||
|
|||
</Grid> |
|||
</Border> |
|||
</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="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}" |
|||
IsVisible="{TemplateBinding AreSeparatorsVisible}" /> |
|||
|
|||
<ContentPresenter Grid.RowSpan="2" |
|||
Grid.Column="1" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
Content="{TemplateBinding Content}" /> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type DataGridRow}" |
|||
TargetType="DataGridRow"> |
|||
<Setter Property="Background" Value="{Binding $parent[DataGrid].RowBackground}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border x:Name="RowBorder" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<DataGridFrozenGrid Name="PART_Root" |
|||
ColumnDefinitions="Auto,*" |
|||
RowDefinitions="*,Auto,Auto"> |
|||
|
|||
<Rectangle Name="BackgroundRectangle" |
|||
Grid.RowSpan="2" |
|||
Grid.ColumnSpan="2" /> |
|||
|
|||
<DataGridRowHeader Name="PART_RowHeader" |
|||
Grid.RowSpan="3" |
|||
DataGridFrozenGrid.IsFrozen="True" /> |
|||
<DataGridCellsPresenter Name="PART_CellsPresenter" |
|||
Grid.Column="1" |
|||
DataGridFrozenGrid.IsFrozen="True" /> |
|||
<DataGridDetailsPresenter Name="PART_DetailsPresenter" |
|||
Grid.Row="1" |
|||
Grid.Column="1" /> |
|||
<Rectangle Name="PART_BottomGridLine" |
|||
Grid.Row="2" |
|||
Grid.Column="1" |
|||
Height="1" |
|||
HorizontalAlignment="Stretch" /> |
|||
|
|||
</DataGridFrozenGrid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ Rectangle#BackgroundRectangle"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
<Setter Property="Fill" Value="{DynamicResource HighlightBrush2}" /> |
|||
</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="SimpleDataGridRowGroupExpanderButtonTheme" |
|||
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 x:DataType="collections:DataGridCollectionViewGroup"> |
|||
<DataGridFrozenGrid Name="Root" |
|||
ColumnDefinitions="Auto,Auto,Auto,Auto" |
|||
RowDefinitions="Auto,*,Auto"> |
|||
|
|||
<Rectangle Name="PART_IndentSpacer" |
|||
Grid.Row="1" |
|||
Grid.Column="1" /> |
|||
<ToggleButton Name="PART_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 SimpleDataGridRowGroupExpanderButtonTheme}" /> |
|||
|
|||
<StackPanel Grid.Row="1" |
|||
Grid.Column="3" |
|||
Margin="0,1,0,1" |
|||
VerticalAlignment="Center" |
|||
Orientation="Horizontal"> |
|||
<TextBlock Name="PART_PropertyNameElement" |
|||
Margin="4,0,0,0" |
|||
IsVisible="{TemplateBinding IsPropertyNameVisible}" /> |
|||
<TextBlock Margin="4,0,0,0" |
|||
Text="{Binding Key}" /> |
|||
<TextBlock Name="PART_ItemCountElement" |
|||
Margin="4,0,0,0" |
|||
IsVisible="{TemplateBinding IsItemCountVisible}" /> |
|||
</StackPanel> |
|||
|
|||
<DataGridRowHeader Name="RowHeader" |
|||
Grid.RowSpan="3" |
|||
DataGridFrozenGrid.IsFrozen="True" /> |
|||
|
|||
</DataGridFrozenGrid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type DataGrid}" |
|||
TargetType="DataGrid"> |
|||
<Setter Property="RowBackground" Value="{DynamicResource ThemeAccentBrush4}" /> |
|||
<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 Width="2" |
|||
Fill="{DynamicResource ThemeBorderHighColor}" /> |
|||
</Template> |
|||
</Setter> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border x:Name="DataGridBorder" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Grid ColumnDefinitions="Auto,*,Auto" |
|||
RowDefinitions="Auto,*,Auto,Auto" |
|||
ClipToBounds="True"> |
|||
<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" |
|||
Height="1" |
|||
VerticalAlignment="Bottom" |
|||
Fill="{DynamicResource ThemeControlMidHighBrush}" |
|||
StrokeThickness="1" /> |
|||
|
|||
<DataGridRowsPresenter Name="PART_RowsPresenter" |
|||
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> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
</Styles.Resources> |
|||
</Styles> |
|||
|
|||
Loading…
Reference in new issue