123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <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" BorderBrush="{DynamicResource Listview_Header_BD_Highlight}" BorderThickness="1,1,0,0" Background="{DynamicResource Listview_Header_BG}" Cursor="Hand">
- <Border x:Name="Inner_BD" SnapsToDevicePixels="true" BorderBrush="{DynamicResource Listview_Header_BD}" BorderThickness="0,0,1,0">
- <Grid>
- <ContentPresenter x:Name="HeaderContent" Margin="5,1" VerticalAlignment="Center" HorizontalAlignment="Center" SnapsToDevicePixels="True" RecognizesAccessKey="True">
- </ContentPresenter>
- <Thumb x:Name="PART_HeaderGripper" Width="8" HorizontalAlignment="Right" Style="{DynamicResource Thumb-ListViewItem}" Margin="0,0,-4,0"/>
- </Grid>
- </Border>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" TargetName="BG" 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" VerticalAlignment="Center" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
- <Thumb Width="10" HorizontalAlignment="Right" Style="{DynamicResource Thumb-ListViewItem}" Margin="-5,0"/>
- </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}" BorderThickness="0,0,0,1" BorderBrush="Gray" SnapsToDevicePixels="True" Cursor="Hand">
- <Grid>
- <Border x:Name="Highlight" BorderBrush="Black" BorderThickness="0" Background="{DynamicResource Listview_BG_Highlight}" Opacity="0"/>
- <GridViewRowPresenter Content="{TemplateBinding Content}" Columns="{TemplateBinding GridView.ColumnCollection}"/>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Opacity" TargetName="Highlight" Value="1"/>
- <Setter Property="BorderThickness" TargetName="Highlight" Value="1"/>
- <Setter Property="Foreground" Value="White"/>
- <Setter Property="Margin" TargetName="Highlight" Value="0,-1"/>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Opacity" TargetName="Highlight" 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" BorderBrush="{DynamicResource Listview_Header_BD}" BorderThickness="1" Background="{DynamicResource Listview_Header_BG}"/>
- <ScrollViewer Focusable="False" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
- <ScrollViewer.LayoutTransform>
- <TransformGroup>
- <ScaleTransform/>
- <SkewTransform/>
- <RotateTransform/>
- <TranslateTransform/>
- </TransformGroup>
- </ScrollViewer.LayoutTransform>
- <GridViewHeaderRowPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
- 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}}"/>
- </ScrollViewer>
- </Grid>
- <Grid Grid.Row="1">
- <Border BorderThickness="1,0,1,1" Background="{DynamicResource Listview_BG_First}" BorderBrush="{DynamicResource Listview_Content_BD}">
- <ScrollContentPresenter Name="PART_ScrollContentPresenter"
- CanContentScroll="{TemplateBinding CanContentScroll}"
- KeyboardNavigation.DirectionalNavigation="Local"
- CanHorizontallyScroll="False"
- CanVerticallyScroll="False"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- Content="{TemplateBinding Content}"/>
- </Border>
- </Grid>
- <ScrollBar x:Name="PART_HorizontalScrollBar" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Grid.Column="0" Grid.Row="2" ViewportSize="{TemplateBinding ViewportWidth}" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" Orientation="Horizontal"/>
- <ScrollBar x:Name="PART_VerticalScrollBar" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Grid.Column="1" Grid.RowSpan="2" Grid.Row="0" ViewportSize="{TemplateBinding ViewportHeight}" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" MinWidth="0"/>
- <DockPanel Grid.Column="1" Grid.Row="2" 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 HorizontalAlignment="Center" Width="1" 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}" BorderThickness="0,0,0,1" BorderBrush="Gray" SnapsToDevicePixels="True" Cursor="Hand">
- <Grid>
- <Border x:Name="Highlight" BorderBrush="Black" BorderThickness="0" Background="{DynamicResource Listview_BG_Highlight}" Opacity="0"/>
- <GridViewRowPresenter Content="{TemplateBinding Content}" Columns="{TemplateBinding GridView.ColumnCollection}"/>
- </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>
|