316 lines
16 KiB
XML
316 lines
16 KiB
XML
<ResourceDictionary
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
mc:Ignorable="d">
|
|
|
|
<SolidColorBrush x:Key="Listview_Header_BD" Color="#FF233661" />
|
|
<SolidColorBrush x:Key="Listview_Header_FG" Color="White" />
|
|
<SolidColorBrush x:Key="Listview_Header_BG_Mouseover" Color="#FF57A3D4" />
|
|
<SolidColorBrush x:Key="Listview_Header_BD_Highlight" Color="#FFB3B9D1" />
|
|
<SolidColorBrush x:Key="Listview_FG_Highlight" Color="#FF233863" />
|
|
<SolidColorBrush x:Key="Listview_BG_Highlight" Color="#FF3399FF" />
|
|
<SolidColorBrush x:Key="Listview_BG_First" Color="#FFEEEEEE" />
|
|
<SolidColorBrush x:Key="Listview_BG_Second" Color="#FFDEDEDE" />
|
|
<SolidColorBrush x:Key="Listview_Header_BG" Color="#FF2F457F" />
|
|
|
|
<SolidColorBrush x:Key="Listview_Content_BD" Color="#FF999999" />
|
|
|
|
<!-- Listview ColumnHeader ControlTemplate -->
|
|
|
|
<Style TargetType="{x:Type GridViewColumnHeader}">
|
|
<Setter Property="FontFamily" Value="Arial" />
|
|
<Setter Property="Foreground" Value="{DynamicResource Listview_Header_FG}" />
|
|
<Setter Property="FontSize" Value="14" />
|
|
<Setter Property="MinHeight" Value="24" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
|
|
|
|
<Border
|
|
x:Name="BG"
|
|
Background="{DynamicResource Listview_Header_BG}"
|
|
BorderBrush="{DynamicResource Listview_Header_BD_Highlight}"
|
|
BorderThickness="1,1,0,0"
|
|
Cursor="Hand">
|
|
<Border
|
|
x:Name="Inner_BD"
|
|
BorderBrush="{DynamicResource Listview_Header_BD}"
|
|
BorderThickness="0,0,1,0"
|
|
SnapsToDevicePixels="true">
|
|
<Grid>
|
|
<ContentPresenter
|
|
x:Name="HeaderContent"
|
|
Margin="5,1"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
RecognizesAccessKey="True"
|
|
SnapsToDevicePixels="True" />
|
|
<Thumb
|
|
x:Name="PART_HeaderGripper"
|
|
Width="8"
|
|
Margin="0,0,-4,0"
|
|
HorizontalAlignment="Right"
|
|
Style="{DynamicResource Thumb-ListViewItem}" />
|
|
</Grid>
|
|
</Border>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="BG" Property="Background" Value="{DynamicResource Listview_Header_BG_Mouseover}" />
|
|
<Setter Property="Foreground" Value="{DynamicResource Listview_FG_Highlight}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="OnlyGripper_GridViewColumnHeader" TargetType="{x:Type GridViewColumnHeader}">
|
|
<Setter Property="MinHeight" Value="24" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
|
|
<Grid x:Name="Grid" SnapsToDevicePixels="true">
|
|
<ContentPresenter
|
|
x:Name="OnlyGripper_HeaderContent"
|
|
Margin="5,0"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
VerticalAlignment="Center"
|
|
RecognizesAccessKey="True"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
<Thumb
|
|
Width="10"
|
|
Margin="-5,0"
|
|
HorizontalAlignment="Right"
|
|
Style="{DynamicResource Thumb-ListViewItem}" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- listview Item Style -->
|
|
|
|
<Style TargetType="{x:Type ListViewItem}">
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Foreground" Value="Black" />
|
|
<Setter Property="FontSize" Value="14" />
|
|
<Setter Property="TextBlock.TextAlignment" Value="Left" />
|
|
<Setter Property="MinHeight" Value="24" />
|
|
<Setter Property="MinWidth" Value="50" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ListViewItem}">
|
|
<Border
|
|
x:Name="BG"
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="Gray"
|
|
BorderThickness="0,0,0,1"
|
|
Cursor="Hand"
|
|
SnapsToDevicePixels="True">
|
|
<Grid>
|
|
<Border
|
|
x:Name="Highlight"
|
|
Background="{DynamicResource Listview_BG_Highlight}"
|
|
BorderBrush="Black"
|
|
BorderThickness="0"
|
|
Opacity="0" />
|
|
<GridViewRowPresenter Columns="{TemplateBinding GridView.ColumnCollection}" Content="{TemplateBinding Content}" />
|
|
</Grid>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsSelected" Value="True">
|
|
<Setter TargetName="Highlight" Property="Opacity" Value="1" />
|
|
<Setter TargetName="Highlight" Property="BorderThickness" Value="1" />
|
|
<Setter Property="Foreground" Value="White" />
|
|
<Setter TargetName="Highlight" Property="Margin" Value="0,-1" />
|
|
</Trigger>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="Highlight" Property="Opacity" Value="0.8" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Style.Triggers>
|
|
<Trigger Property="ListView.AlternationIndex" Value="0">
|
|
<Setter Property="Background" Value="{DynamicResource Listview_BG_First}" />
|
|
</Trigger>
|
|
<Trigger Property="ListView.AlternationIndex" Value="1">
|
|
<Setter Property="Background" Value="{DynamicResource Listview_BG_Second}" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<!-- listview Style -->
|
|
|
|
<Style x:Key="ListView-ScrollViewer" TargetType="{x:Type ScrollViewer}">
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
<Setter Property="CanContentScroll" Value="False" />
|
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
|
|
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ScrollViewer}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Grid>
|
|
<Border
|
|
x:Name="TopBG"
|
|
MinHeight="24"
|
|
Background="{DynamicResource Listview_Header_BG}"
|
|
BorderBrush="{DynamicResource Listview_Header_BD}"
|
|
BorderThickness="1" />
|
|
<ScrollViewer
|
|
Focusable="False"
|
|
HorizontalScrollBarVisibility="Hidden"
|
|
VerticalScrollBarVisibility="Hidden">
|
|
<ScrollViewer.LayoutTransform>
|
|
<TransformGroup>
|
|
<ScaleTransform />
|
|
<SkewTransform />
|
|
<RotateTransform />
|
|
<TranslateTransform />
|
|
</TransformGroup>
|
|
</ScrollViewer.LayoutTransform>
|
|
<GridViewHeaderRowPresenter
|
|
AllowsColumnReorder="{Binding TemplatedParent.View.AllowsColumnReorder, RelativeSource={RelativeSource TemplatedParent}}"
|
|
ColumnHeaderContainerStyle="{Binding TemplatedParent.View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource TemplatedParent}}"
|
|
ColumnHeaderContextMenu="{Binding TemplatedParent.View.ColumnHeaderContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
|
|
ColumnHeaderTemplate="{Binding TemplatedParent.View.ColumnHeaderTemplate, RelativeSource={RelativeSource TemplatedParent}}"
|
|
ColumnHeaderToolTip="{Binding TemplatedParent.View.ColumnHeaderToolTip, RelativeSource={RelativeSource TemplatedParent}}"
|
|
Columns="{Binding TemplatedParent.View.Columns, RelativeSource={RelativeSource TemplatedParent}}"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
</ScrollViewer>
|
|
</Grid>
|
|
<Grid Grid.Row="1">
|
|
<Border
|
|
Background="{DynamicResource Listview_BG_First}"
|
|
BorderBrush="{DynamicResource Listview_Content_BD}"
|
|
BorderThickness="1,0,1,1">
|
|
<ScrollContentPresenter
|
|
Name="PART_ScrollContentPresenter"
|
|
CanContentScroll="{TemplateBinding CanContentScroll}"
|
|
CanHorizontallyScroll="False"
|
|
CanVerticallyScroll="False"
|
|
Content="{TemplateBinding Content}"
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
KeyboardNavigation.DirectionalNavigation="Local" />
|
|
</Border>
|
|
</Grid>
|
|
<ScrollBar
|
|
x:Name="PART_HorizontalScrollBar"
|
|
Grid.Row="2"
|
|
Grid.Column="0"
|
|
Maximum="{TemplateBinding ScrollableWidth}"
|
|
Minimum="0"
|
|
Orientation="Horizontal"
|
|
ViewportSize="{TemplateBinding ViewportWidth}"
|
|
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
|
|
Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
<ScrollBar
|
|
x:Name="PART_VerticalScrollBar"
|
|
Grid.Row="0"
|
|
Grid.RowSpan="2"
|
|
Grid.Column="1"
|
|
MinWidth="0"
|
|
Maximum="{TemplateBinding ScrollableHeight}"
|
|
Minimum="0"
|
|
ViewportSize="{TemplateBinding ViewportHeight}"
|
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
|
|
Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
<DockPanel
|
|
Grid.Row="2"
|
|
Grid.Column="1"
|
|
LastChildFill="False" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="Thumb-ListViewItem" TargetType="{x:Type Thumb}">
|
|
<Setter Property="Width" Value="8" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Thumb}">
|
|
<Border Padding="{TemplateBinding Padding}" Background="Transparent">
|
|
<Rectangle
|
|
Width="1"
|
|
HorizontalAlignment="Center"
|
|
Opacity="1" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style TargetType="{x:Type ListView}">
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ListView}">
|
|
<Border Name="Border">
|
|
<ScrollViewer Style="{DynamicResource ListView-ScrollViewer}">
|
|
<ItemsPresenter Grid.Row="0" />
|
|
</ScrollViewer>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
|
|
<Style x:Key="NoSelection-ListViewItem" TargetType="{x:Type ListViewItem}">
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Foreground" Value="Black" />
|
|
<Setter Property="FontSize" Value="14" />
|
|
<Setter Property="TextBlock.TextAlignment" Value="Left" />
|
|
<Setter Property="MinHeight" Value="24" />
|
|
<Setter Property="MinWidth" Value="50" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ListViewItem}">
|
|
<Border
|
|
x:Name="BG"
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="Gray"
|
|
BorderThickness="0,0,0,1"
|
|
Cursor="Hand"
|
|
SnapsToDevicePixels="True">
|
|
<Grid>
|
|
<Border
|
|
x:Name="Highlight"
|
|
Background="{DynamicResource Listview_BG_Highlight}"
|
|
BorderBrush="Black"
|
|
BorderThickness="0"
|
|
Opacity="0" />
|
|
<GridViewRowPresenter Columns="{TemplateBinding GridView.ColumnCollection}" Content="{TemplateBinding Content}" />
|
|
</Grid>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Style.Triggers>
|
|
<Trigger Property="ListView.AlternationIndex" Value="0">
|
|
<Setter Property="Background" Value="{DynamicResource Listview_BG_First}" />
|
|
</Trigger>
|
|
<Trigger Property="ListView.AlternationIndex" Value="1">
|
|
<Setter Property="Background" Value="{DynamicResource Listview_BG_Second}" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
|
|
</ResourceDictionary> |