Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Style TargetType="{x:Type GridViewColumnHeader}" x:Key="gridViewColumnStyle">
- <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
- <Setter Property="VerticalContentAlignment" Value="Stretch"/>
- <Setter Property="Background" Value="{StaticResource GridViewHeaderBackgroundColor}"/>
- <Setter Property="BorderBrush" Value="{StaticResource GridViewHeaderForegroundColor}"/>
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="Padding" Value="2,0,2,0"/>
- <Setter Property="Foreground" Value="{StaticResource GridViewHeaderForegroundColor}"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
- <Grid SnapsToDevicePixels="true" Tag="Header" Name="Header">
- <ContentPresenter Name="HeaderContent" Margin="0,0,0,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- <Canvas>
- <Thumb x:Name="PART_HeaderGripper" Style="{StaticResource GridViewColumnHeaderGripper}"/>
- </Canvas>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- </Trigger>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="HeaderContent" Property="Margin" Value="1,1,0,0"/>
- </Trigger>
- <Trigger Property="Height" Value="Auto">
- <Setter Property="MinHeight" Value="20"/>
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="GridViewColumnHeaderGripper"
- TargetType="{x:Type Thumb}">
- <Setter Property="Canvas.Right"
- Value="-9"/>
- <Setter Property="Width"
- Value="18"/>
- <Setter Property="Height"
- Value="{Binding Path=ActualHeight,RelativeSource={RelativeSource TemplatedParent}}"/>
- <Setter Property="Padding"
- Value="0"/>
- <Setter Property="Background"
- Value="{StaticResource GridViewColumnHeaderBorderBackground}"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Thumb}">
- <Border Padding="{TemplateBinding Padding}"
- Background="Transparent">
- <Rectangle HorizontalAlignment="Center"
- Width="1"
- Fill="{TemplateBinding Background}"/>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
Add Comment
Please, Sign In to add comment