Skip to content

Commit

Permalink
update in DataGrid Style.
Browse files Browse the repository at this point in the history
update in DataGrid Style.
  • Loading branch information
yanjinhuagood committed Feb 18, 2023
1 parent 5125c8a commit 7effcbb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
11 changes: 6 additions & 5 deletions src/WPFDevelopers.Net40/Themes/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2458,7 +2458,7 @@
<Setter Property="Validation.ErrorTemplate" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0,0,0,1" />
<Setter Property="BorderBrush" Value="{DynamicResource BaseSolidColorBrush}" />
<Setter Property="Background" Value="{DynamicResource BackgroundColor}" />
<Setter Property="Background" Value="{DynamicResource BackgroundSolidColorBrush}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="ValidationErrorTemplate">
<Setter.Value>
Expand Down Expand Up @@ -2536,10 +2536,11 @@
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridRowHeader}">
<Grid HorizontalAlignment="Center">
<controls:SmallPanel HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
Expand Down Expand Up @@ -2568,7 +2569,7 @@
</Border>
<Thumb x:Name="PART_TopHeaderGripper" Style="{StaticResource RowHeaderGripperStyle}" VerticalAlignment="Top" />
<Thumb x:Name="PART_BottomHeaderGripper" Style="{StaticResource RowHeaderGripperStyle}" VerticalAlignment="Bottom" />
</Grid>
</controls:SmallPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down Expand Up @@ -2609,7 +2610,7 @@
<DoubleAnimation Storyboard.TargetProperty="(Path.RenderTransform).(RotateTransform.Angle)" Storyboard.TargetName="SortArrow" Duration="00:00:.2" To="0" />
</Storyboard>
</ControlTemplate.Resources>
<Grid>
<controls:SmallPanel>
<Border x:Name="columnHeaderBorder" Background="{TemplateBinding Background}" Padding="10" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
<Grid Name="HedearGrid">
<Grid.ColumnDefinitions>
Expand All @@ -2626,7 +2627,7 @@
</Border>
<Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" Style="{StaticResource ColumnHeaderGripperStyle}" />
<Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" Style="{StaticResource ColumnHeaderGripperStyle}" />
</Grid>
</controls:SmallPanel>
<ControlTemplate.Triggers>
<Trigger Property="SortDirection" Value="Ascending">
<Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
Expand Down
11 changes: 6 additions & 5 deletions src/WPFDevelopers.Net45x/Themes/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2459,7 +2459,7 @@
<Setter Property="Validation.ErrorTemplate" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0,0,0,1" />
<Setter Property="BorderBrush" Value="{DynamicResource BaseSolidColorBrush}" />
<Setter Property="Background" Value="{DynamicResource BackgroundColor}" />
<Setter Property="Background" Value="{DynamicResource BackgroundSolidColorBrush}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="ValidationErrorTemplate">
<Setter.Value>
Expand Down Expand Up @@ -2537,10 +2537,11 @@
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridRowHeader}">
<Grid HorizontalAlignment="Center">
<controls:SmallPanel HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
Expand Down Expand Up @@ -2569,7 +2570,7 @@
</Border>
<Thumb x:Name="PART_TopHeaderGripper" Style="{StaticResource RowHeaderGripperStyle}" VerticalAlignment="Top" />
<Thumb x:Name="PART_BottomHeaderGripper" Style="{StaticResource RowHeaderGripperStyle}" VerticalAlignment="Bottom" />
</Grid>
</controls:SmallPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down Expand Up @@ -2610,7 +2611,7 @@
<DoubleAnimation Storyboard.TargetProperty="(Path.RenderTransform).(RotateTransform.Angle)" Storyboard.TargetName="SortArrow" Duration="00:00:.2" To="0" />
</Storyboard>
</ControlTemplate.Resources>
<Grid>
<controls:SmallPanel>
<Border x:Name="columnHeaderBorder" Background="{TemplateBinding Background}" Padding="10" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
<Grid Name="HedearGrid">
<Grid.ColumnDefinitions>
Expand All @@ -2627,7 +2628,7 @@
</Border>
<Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" Style="{StaticResource ColumnHeaderGripperStyle}" />
<Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" Style="{StaticResource ColumnHeaderGripperStyle}" />
</Grid>
</controls:SmallPanel>
<ControlTemplate.Triggers>
<Trigger Property="SortDirection" Value="Ascending">
<Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsChecked}"/>
<CheckBox Margin="10,0,0,0" IsChecked="{Binding IsChecked}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
Expand Down
12 changes: 7 additions & 5 deletions src/WPFDevelopers.Shared/Styles/Styles.DataGrid.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
<Setter Property="Validation.ErrorTemplate" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0,0,0,1"/>
<Setter Property="BorderBrush" Value="{DynamicResource BaseSolidColorBrush}"/>
<Setter Property="Background" Value="{DynamicResource BackgroundColor}"/>
<Setter Property="Background" Value="{DynamicResource BackgroundSolidColorBrush}"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="ValidationErrorTemplate">
<Setter.Value>
Expand Down Expand Up @@ -325,10 +325,12 @@
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridRowHeader}">
<Grid HorizontalAlignment="Center">
<controls:SmallPanel HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
Expand Down Expand Up @@ -371,7 +373,7 @@
<Thumb x:Name="PART_BottomHeaderGripper"
Style="{StaticResource RowHeaderGripperStyle}"
VerticalAlignment="Bottom" />
</Grid>
</controls:SmallPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down Expand Up @@ -424,7 +426,7 @@
Duration="00:00:.2" To="0"/>
</Storyboard>
</ControlTemplate.Resources>
<Grid>
<controls:SmallPanel>
<Border x:Name="columnHeaderBorder"
Background="{TemplateBinding Background}"
Padding="10"
Expand Down Expand Up @@ -459,7 +461,7 @@
<Thumb x:Name="PART_RightHeaderGripper"
HorizontalAlignment="Right"
Style="{StaticResource ColumnHeaderGripperStyle}" />
</Grid>
</controls:SmallPanel>
<ControlTemplate.Triggers>
<Trigger Property="SortDirection" Value="Ascending">
<Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
Expand Down

0 comments on commit 7effcbb

Please sign in to comment.