整理代码
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:assists="clr-namespace:Melskin.Assists"
|
||||
xmlns:internal="clr-namespace:Melskin.Converters.Internal"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Style TargetType="{x:Type Thumb}" x:Key="GridViewColumnHeaderGripperStyle">
|
||||
xmlns:internal="clr-namespace:Melskin.Converters.Internal">
|
||||
<Style x:Key="GridViewColumnHeaderGripperStyle" TargetType="{x:Type Thumb}">
|
||||
<Setter Property="Background" Value="{DynamicResource DividerBrush}" />
|
||||
<Setter Property="Width" Value="12" />
|
||||
<Setter Property="Cursor" Value="SizeNS" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Thumb}">
|
||||
<Grid Background="Transparent" Margin="6,6,-6,6">
|
||||
<Grid Margin="6,6,-6,6" Background="Transparent">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
HorizontalAlignment="Center"
|
||||
Width="1"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Width="1" />
|
||||
HorizontalAlignment="Center"
|
||||
Background="{TemplateBinding Background}" />
|
||||
</Grid>
|
||||
|
||||
</ControlTemplate>
|
||||
@@ -35,30 +35,30 @@
|
||||
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
|
||||
<Grid SnapsToDevicePixels="true">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
CornerRadius="4"
|
||||
x:Name="HeaderBorder"
|
||||
Margin="2"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
x:Name="HeaderBorder">
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
CornerRadius="4">
|
||||
<ContentPresenter
|
||||
x:Name="HeaderContent"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
x:Name="HeaderContent" />
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</Border>
|
||||
<Thumb
|
||||
x:Name="PART_HeaderGripper"
|
||||
HorizontalAlignment="Right"
|
||||
Style="{StaticResource GridViewColumnHeaderGripperStyle}"
|
||||
x:Name="PART_HeaderGripper" />
|
||||
Style="{StaticResource GridViewColumnHeaderGripperStyle}" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Background" TargetName="HeaderBorder" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
||||
<Setter TargetName="HeaderBorder" Property="Background" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter Property="Background" TargetName="HeaderBorder" Value="{DynamicResource BackgroundFloatingBrush}" />
|
||||
<Setter TargetName="HeaderBorder" Property="Background" Value="{DynamicResource BackgroundFloatingBrush}" />
|
||||
<!--<Setter Property="Visibility" TargetName="PART_HeaderGripper"
|
||||
Value="Hidden"/>-->
|
||||
</Trigger>
|
||||
@@ -80,12 +80,12 @@
|
||||
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
|
||||
<Canvas x:Name="PART_FloatingHeaderCanvas">
|
||||
<Rectangle
|
||||
Fill="{DynamicResource BackgroundFloatingBrush}"
|
||||
Width="{TemplateBinding ActualWidth}"
|
||||
Height="{TemplateBinding ActualHeight}"
|
||||
Fill="{DynamicResource BackgroundFloatingBrush}"
|
||||
Opacity="0.4"
|
||||
RadiusX="2"
|
||||
RadiusY="2"
|
||||
Width="{TemplateBinding ActualWidth}" />
|
||||
RadiusY="2" />
|
||||
</Canvas>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
@@ -96,9 +96,9 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
|
||||
<Border
|
||||
x:Name="HeaderBorder"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
x:Name="HeaderBorder" />
|
||||
BorderBrush="{TemplateBinding BorderBrush}" />
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Height" Value="Auto">
|
||||
<Setter Property="MinHeight" Value="20" />
|
||||
@@ -128,12 +128,12 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ListView}">
|
||||
<Border
|
||||
x:Name="Bd"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4"
|
||||
SnapsToDevicePixels="true"
|
||||
x:Name="Bd">
|
||||
SnapsToDevicePixels="true">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
@@ -141,26 +141,26 @@
|
||||
</Grid.RowDefinitions>
|
||||
<Border Background="{DynamicResource BackgroundLayoutBrush}" CornerRadius="4,4,0,0">
|
||||
<ScrollViewer
|
||||
x:Name="headerScroll"
|
||||
HorizontalScrollBarVisibility="Hidden"
|
||||
VerticalScrollBarVisibility="Disabled"
|
||||
x:Name="headerScroll">
|
||||
VerticalScrollBarVisibility="Disabled">
|
||||
<GridViewHeaderRowPresenter
|
||||
Margin="4,0"
|
||||
AllowsColumnReorder="{Binding View.AllowsColumnReorder, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ColumnHeaderContainerStyle="{Binding View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ColumnHeaderContextMenu="{Binding View.ColumnHeaderContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ColumnHeaderTemplate="{Binding View.ColumnHeaderTemplate, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ColumnHeaderToolTip="{Binding View.ColumnHeaderToolTip, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Columns="{Binding View.Columns, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Margin="4,0"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
<ScrollViewer
|
||||
Focusable="false"
|
||||
Grid.Row="1"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
assists:ControlAssist.SynchronizedScroll="{Binding ElementName=headerScroll}">
|
||||
assists:ControlAssist.SynchronizedScroll="{Binding ElementName=headerScroll}"
|
||||
Focusable="false">
|
||||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
@@ -168,7 +168,7 @@
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
@@ -203,32 +203,32 @@
|
||||
IsHitTestVisible="False"
|
||||
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(ItemsControl.AlternationIndex), Converter={x:Static internal:InterlacedBackgroundConverter.Instance}}" />
|
||||
<Border
|
||||
x:Name="Bd"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
SnapsToDevicePixels="true"
|
||||
x:Name="Bd">
|
||||
SnapsToDevicePixels="true">
|
||||
<Grid>
|
||||
<GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
<ContentPresenter
|
||||
x:Name="contentPresenter"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Visibility="Collapsed"
|
||||
x:Name="contentPresenter" />
|
||||
Visibility="Collapsed" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="GridView.ColumnCollection" Value="{x:Null}">
|
||||
<Setter Property="Visibility" TargetName="contentPresenter" Value="Visible" />
|
||||
<Setter TargetName="contentPresenter" Property="Visibility" Value="Visible" />
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
||||
</MultiTrigger>
|
||||
<!-- 选中对象无焦点 -->
|
||||
<MultiTrigger>
|
||||
@@ -236,7 +236,7 @@
|
||||
<Condition Property="Selector.IsSelectionActive" Value="False" />
|
||||
<Condition Property="IsSelected" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource BackgroundFloatingBrush}" />
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource BackgroundFloatingBrush}" />
|
||||
</MultiTrigger>
|
||||
<!-- 选中对象有焦点 -->
|
||||
<MultiTrigger>
|
||||
@@ -244,11 +244,11 @@
|
||||
<Condition Property="Selector.IsSelectionActive" Value="True" />
|
||||
<Condition Property="IsSelected" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource TextAccentBrush}" />
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource TextAccentBrush}" />
|
||||
</MultiTrigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource TextDisabledBrush}" />
|
||||
<Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
Reference in New Issue
Block a user