|
@@ -11,61 +11,12 @@
|
|
|
<Setter Property="FontFamily" Value="{DynamicResource FontFamily.Global}"/>
|
|
<Setter Property="FontFamily" Value="{DynamicResource FontFamily.Global}"/>
|
|
|
<Setter Property="FontSize" Value="{DynamicResource FontSize.Title}" />
|
|
<Setter Property="FontSize" Value="{DynamicResource FontSize.Title}" />
|
|
|
<Setter Property="Cursor" Value="Hand" />
|
|
<Setter Property="Cursor" Value="Hand" />
|
|
|
- <Setter Property="Background" Value="{DynamicResource Brush.TextContrast}"/>
|
|
|
|
|
|
|
+ <Setter Property="Background" Value="{DynamicResource Brush.DashboardBackground}"/>
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
|
<Setter Property="BorderBrush" Value="Transparent"/>
|
|
<Setter Property="BorderBrush" Value="Transparent"/>
|
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
|
- <Setter Property="Height" Value="30"/>
|
|
|
|
|
- <!--<Setter Property="Padding" Value="5,0"/>-->
|
|
|
|
|
- <Setter Property="Template">
|
|
|
|
|
- <Setter.Value>
|
|
|
|
|
- <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
|
|
|
|
|
- <Grid>
|
|
|
|
|
- <Border x:Name="BackgroundBorder"
|
|
|
|
|
- BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
- BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
- Background="{TemplateBinding Background}"
|
|
|
|
|
- Height="{TemplateBinding Height}"
|
|
|
|
|
- Width="{TemplateBinding Width}"
|
|
|
|
|
- MinHeight="{TemplateBinding MinHeight}"
|
|
|
|
|
- MinWidth="{TemplateBinding MinWidth}">
|
|
|
|
|
- <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
- Content="{TemplateBinding Content}"
|
|
|
|
|
- Margin="{TemplateBinding Padding}"/>
|
|
|
|
|
- </Border>
|
|
|
|
|
- <!-- 列分隔线 -->
|
|
|
|
|
- <Thumb x:Name="PART_RightHeaderGripper"
|
|
|
|
|
- HorizontalAlignment="Right"
|
|
|
|
|
- VerticalAlignment="Stretch"
|
|
|
|
|
- Width="4"
|
|
|
|
|
- Cursor="SizeWE"
|
|
|
|
|
- Background="Transparent">
|
|
|
|
|
- <Thumb.Style>
|
|
|
|
|
- <Style TargetType="{x:Type Thumb}">
|
|
|
|
|
- <Setter Property="Background" Value="Transparent"/>
|
|
|
|
|
- <Setter Property="Template">
|
|
|
|
|
- <Setter.Value>
|
|
|
|
|
- <ControlTemplate TargetType="{x:Type Thumb}">
|
|
|
|
|
- <Border Background="{TemplateBinding Background}"
|
|
|
|
|
- Margin="0 1 0 1">
|
|
|
|
|
- <Border Background="{DynamicResource Brush.Border}"
|
|
|
|
|
- Width="1"
|
|
|
|
|
- HorizontalAlignment="Center"
|
|
|
|
|
- VerticalAlignment="Stretch"/>
|
|
|
|
|
- </Border>
|
|
|
|
|
- </ControlTemplate>
|
|
|
|
|
- </Setter.Value>
|
|
|
|
|
- </Setter>
|
|
|
|
|
- </Style>
|
|
|
|
|
- </Thumb.Style>
|
|
|
|
|
- </Thumb>
|
|
|
|
|
- </Grid>
|
|
|
|
|
- </ControlTemplate>
|
|
|
|
|
- </Setter.Value>
|
|
|
|
|
- </Setter>
|
|
|
|
|
</Style>
|
|
</Style>
|
|
|
|
|
|
|
|
<!-- 列表项样式 -->
|
|
<!-- 列表项样式 -->
|
|
@@ -76,7 +27,7 @@
|
|
|
<Setter Property="Foreground" Value="{DynamicResource Brush.Text}" />
|
|
<Setter Property="Foreground" Value="{DynamicResource Brush.Text}" />
|
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
|
- <Setter Property="Padding" Value="5,0"/>
|
|
|
|
|
|
|
+ <Setter Property="Padding" Value="0 3 0 3"/>
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
|
<Setter Property="Template">
|
|
<Setter Property="Template">
|
|
@@ -86,336 +37,55 @@
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
Padding="{TemplateBinding Padding}"
|
|
Padding="{TemplateBinding Padding}"
|
|
|
- SnapsToDevicePixels="True">
|
|
|
|
|
|
|
+ SnapsToDevicePixels="True"
|
|
|
|
|
+ x:Name="bd">
|
|
|
<GridViewRowPresenter Content="{TemplateBinding Content}"
|
|
<GridViewRowPresenter Content="{TemplateBinding Content}"
|
|
|
- Columns="{TemplateBinding GridView.ColumnCollection}"
|
|
|
|
|
- Margin="{TemplateBinding Padding}"
|
|
|
|
|
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
|
|
|
|
|
+ Columns="{TemplateBinding GridView.ColumnCollection}"
|
|
|
|
|
+ Margin="{TemplateBinding Padding}"
|
|
|
|
|
+ VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
+ />
|
|
|
</Border>
|
|
</Border>
|
|
|
<ControlTemplate.Triggers>
|
|
<ControlTemplate.Triggers>
|
|
|
- <!-- 选中状态 -->
|
|
|
|
|
- <Trigger Property="IsSelected" Value="True">
|
|
|
|
|
- <Setter Property="Background" Value="{DynamicResource Brush.SelectionSelected}"/>
|
|
|
|
|
- <Setter Property="Foreground" Value="{DynamicResource Brush.TextContrast}"/>
|
|
|
|
|
- </Trigger>
|
|
|
|
|
- <!-- 鼠标悬停 -->
|
|
|
|
|
|
|
+ <!--鼠标悬停-->
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
- <Setter Property="Background" Value="{DynamicResource Brush.Overlay48Percent}"/>
|
|
|
|
|
- </Trigger>
|
|
|
|
|
- <!-- 交替行背景 -->
|
|
|
|
|
- <Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
|
|
|
|
- <Setter Property="Background" Value="{DynamicResource Brush.BodyAlternative}" />
|
|
|
|
|
- </Trigger>
|
|
|
|
|
- <Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
|
|
|
|
- <Setter Property="Background" Value="{DynamicResource Brush.HeaderAlternative}" />
|
|
|
|
|
|
|
+ <Setter TargetName="bd" Property="Background" Value="{DynamicResource Brush.Overlay48Percent}"/>
|
|
|
</Trigger>
|
|
</Trigger>
|
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate.Triggers>
|
|
|
</ControlTemplate>
|
|
</ControlTemplate>
|
|
|
</Setter.Value>
|
|
</Setter.Value>
|
|
|
</Setter>
|
|
</Setter>
|
|
|
|
|
+ <Style.Triggers>
|
|
|
|
|
+ <Trigger Property="IsSelected" Value="True">
|
|
|
|
|
+ <!--<Setter Property="Background" Value="{DynamicResource Brush.TextContrast}"/>-->
|
|
|
|
|
+ <Setter Property="Foreground" Value="{DynamicResource Brush.SelectionSelected}"/>
|
|
|
|
|
+ </Trigger>
|
|
|
|
|
+ <!-- 鼠标悬停 -->
|
|
|
|
|
+ <Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
+ <Setter Property="Background" Value="{DynamicResource Brush.Overlay48Percent}"/>
|
|
|
|
|
+ </Trigger>
|
|
|
|
|
+ <!-- 交替行背景 -->
|
|
|
|
|
+ <Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
|
|
|
|
+ <Setter Property="Background" Value="{DynamicResource Brush.BodyAlternative}" />
|
|
|
|
|
+ </Trigger>
|
|
|
|
|
+ <Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
|
|
|
|
+ <Setter Property="Background" Value="{DynamicResource Brush.HeaderAlternative}" />
|
|
|
|
|
+ </Trigger>
|
|
|
|
|
+ </Style.Triggers>
|
|
|
</Style>
|
|
</Style>
|
|
|
|
|
|
|
|
- <!-- ListView整体模板 -->
|
|
|
|
|
- <ControlTemplate x:Key="Template.ListView" TargetType="{x:Type ListView}">
|
|
|
|
|
- <Border BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
- BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
- Background="{TemplateBinding Background}"
|
|
|
|
|
- SnapsToDevicePixels="True">
|
|
|
|
|
- <ScrollViewer x:Name="PART_ScrollViewer"
|
|
|
|
|
- Focusable="False"
|
|
|
|
|
- Padding="{TemplateBinding Padding}"
|
|
|
|
|
- CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
|
|
|
|
|
- HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
|
|
|
|
- VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
|
|
|
|
- Background="{TemplateBinding Background}"
|
|
|
|
|
- Style="{DynamicResource ScrollViewer.Default}">
|
|
|
|
|
-
|
|
|
|
|
- <DockPanel>
|
|
|
|
|
- <ContentPresenter DockPanel.Dock="Top"
|
|
|
|
|
- x:Name="PART_HeaderPresenter"/>
|
|
|
|
|
- <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
|
|
|
|
- </DockPanel>
|
|
|
|
|
- </ScrollViewer>
|
|
|
|
|
- </Border>
|
|
|
|
|
- </ControlTemplate>
|
|
|
|
|
-
|
|
|
|
|
<!-- 主要ListView样式 -->
|
|
<!-- 主要ListView样式 -->
|
|
|
<Style x:Key="ListView.Primary" TargetType="{x:Type ListView}">
|
|
<Style x:Key="ListView.Primary" TargetType="{x:Type ListView}">
|
|
|
<Setter Property="Background" Value="{DynamicResource Brush.TextContrast}" />
|
|
<Setter Property="Background" Value="{DynamicResource Brush.TextContrast}" />
|
|
|
<Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
|
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Border}"/>
|
|
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Border}"/>
|
|
|
- <Setter Property="BorderThickness" Value="1"/>
|
|
|
|
|
|
|
+ <Setter Property="BorderThickness" Value="0"/>
|
|
|
<Setter Property="Padding" Value="0"/>
|
|
<Setter Property="Padding" Value="0"/>
|
|
|
<Setter Property="AlternationCount" Value="2"/>
|
|
<Setter Property="AlternationCount" Value="2"/>
|
|
|
<Setter Property="ItemContainerStyle" Value="{DynamicResource ListView.ListViewItem}"/>
|
|
<Setter Property="ItemContainerStyle" Value="{DynamicResource ListView.ListViewItem}"/>
|
|
|
|
|
+ <Setter Property="FontSize" Value="{DynamicResource FontSize.Body}"/>
|
|
|
<Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
|
|
<Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
|
|
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
|
|
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
|
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
|
|
- <Setter Property="Template">
|
|
|
|
|
- <Setter.Value>
|
|
|
|
|
- <ControlTemplate TargetType="{x:Type ListView}">
|
|
|
|
|
- <Border BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
- BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
- Background="{TemplateBinding Background}"
|
|
|
|
|
- Padding="{TemplateBinding Padding}">
|
|
|
|
|
- <!--<Grid>
|
|
|
|
|
- <Grid.RowDefinitions>
|
|
|
|
|
- <RowDefinition Height="Auto"/>
|
|
|
|
|
- <RowDefinition Height="*"/>
|
|
|
|
|
- </Grid.RowDefinitions>
|
|
|
|
|
- <ContentPresenter Grid.Row="0"
|
|
|
|
|
- Margin="0"/>-->
|
|
|
|
|
-
|
|
|
|
|
- <!-- 内容区域 -->
|
|
|
|
|
- <!--<ScrollViewer Grid.Row="1"
|
|
|
|
|
- x:Name="PART_ScrollViewer"
|
|
|
|
|
- Focusable="False"
|
|
|
|
|
- CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
|
|
|
|
|
- HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
|
|
|
|
- VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
|
|
|
|
- Background="{TemplateBinding Background}"
|
|
|
|
|
- Style="{DynamicResource ScrollViewer.Default}">
|
|
|
|
|
- <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
|
|
|
- Margin="{TemplateBinding Padding}"/>
|
|
|
|
|
- </ScrollViewer>-->
|
|
|
|
|
- <!--</Grid>-->
|
|
|
|
|
- <DockPanel>
|
|
|
|
|
- <ContentPresenter DockPanel.Dock="Top" x:Name="PART_HeaderPresenter"/>
|
|
|
|
|
- <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
|
|
|
|
- </DockPanel>
|
|
|
|
|
- </Border>
|
|
|
|
|
- </ControlTemplate>
|
|
|
|
|
- </Setter.Value>
|
|
|
|
|
- </Setter>
|
|
|
|
|
- </Style>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 无列头版本 -->
|
|
|
|
|
- <Style x:Key="ListView.Primary.NoHeader" TargetType="{x:Type ListView}" BasedOn="{StaticResource ListView.Primary}">
|
|
|
|
|
- <Setter Property="Template">
|
|
|
|
|
- <Setter.Value>
|
|
|
|
|
- <ControlTemplate TargetType="{x:Type ListView}">
|
|
|
|
|
- <Border BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
- BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
- Background="{TemplateBinding Background}"
|
|
|
|
|
- Padding="{TemplateBinding Padding}">
|
|
|
|
|
- <ScrollViewer x:Name="PART_ScrollViewer"
|
|
|
|
|
- Focusable="False"
|
|
|
|
|
- CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
|
|
|
|
|
- HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
|
|
|
|
- VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
|
|
|
|
- Background="{TemplateBinding Background}"
|
|
|
|
|
- Style="{DynamicResource ScrollViewer.Default}">
|
|
|
|
|
- <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
|
|
|
- Margin="{TemplateBinding Padding}"/>
|
|
|
|
|
- </ScrollViewer>
|
|
|
|
|
- </Border>
|
|
|
|
|
- </ControlTemplate>
|
|
|
|
|
- </Setter.Value>
|
|
|
|
|
- </Setter>
|
|
|
|
|
- </Style>
|
|
|
|
|
- <!--无边框版本-->
|
|
|
|
|
- <Style x:Key="ListView.Primary.NoBorder" TargetType="{x:Type ListView}" BasedOn="{StaticResource ListView.Primary}">
|
|
|
|
|
- <Setter Property="BorderThickness" Value="0"/>
|
|
|
|
|
- <Setter Property="Background" Value="Transparent"/>
|
|
|
|
|
- </Style>
|
|
|
|
|
-
|
|
|
|
|
- <Style x:Key="ListView.ListViewItem.Colored" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource ListView.ListViewItem}">
|
|
|
|
|
- <Style.Triggers>
|
|
|
|
|
- <Trigger Property="IsSelected" Value="True">
|
|
|
|
|
- <Setter Property="Background" Value="{DynamicResource Brush.SelectionSelectedBackground}"/>
|
|
|
|
|
- <Setter Property="Foreground" Value="White"/>
|
|
|
|
|
- </Trigger>
|
|
|
|
|
- </Style.Triggers>
|
|
|
|
|
- </Style>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 定义颜色资源 -->
|
|
|
|
|
- <SolidColorBrush x:Key="HeaderBackground" Color="#2C3E50"/>
|
|
|
|
|
- <SolidColorBrush x:Key="HeaderForeground" Color="White"/>
|
|
|
|
|
- <SolidColorBrush x:Key="RowHoverBackground" Color="#EBF5FB"/>
|
|
|
|
|
- <SolidColorBrush x:Key="RowSelectedBackground" Color="#5DADE2"/>
|
|
|
|
|
- <SolidColorBrush x:Key="RowSelectedForeground" Color="White"/>
|
|
|
|
|
- <SolidColorBrush x:Key="AlternateRowBackground" Color="#F4F6F7"/>
|
|
|
|
|
- <SolidColorBrush x:Key="NormalRowBackground" Color="White"/>
|
|
|
|
|
- <SolidColorBrush x:Key="GridLineBrush" Color="#BDC3C7"/>
|
|
|
|
|
-
|
|
|
|
|
- <!-- ListViewItem 样式 -->
|
|
|
|
|
- <Style x:Key="CustomListViewItemStyle" TargetType="ListViewItem">
|
|
|
|
|
- <Setter Property="Background" Value="{StaticResource NormalRowBackground}"/>
|
|
|
|
|
- <Setter Property="Foreground" Value="#2C3E50"/>
|
|
|
|
|
- <Setter Property="FontSize" Value="13"/>
|
|
|
|
|
- <Setter Property="Height" Value="35"/>
|
|
|
|
|
- <Setter Property="BorderThickness" Value="0,0,0,1"/>
|
|
|
|
|
- <Setter Property="BorderBrush" Value="{StaticResource GridLineBrush}"/>
|
|
|
|
|
- <Setter Property="Cursor" Value="Hand"/>
|
|
|
|
|
-
|
|
|
|
|
- <Setter Property="Template">
|
|
|
|
|
- <Setter.Value>
|
|
|
|
|
- <ControlTemplate TargetType="ListViewItem">
|
|
|
|
|
- <Border x:Name="Bd"
|
|
|
|
|
- Background="{TemplateBinding Background}"
|
|
|
|
|
- BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
- BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
- Padding="10,5">
|
|
|
|
|
- <ContentPresenter HorizontalAlignment="Left"
|
|
|
|
|
- VerticalAlignment="Center"/>
|
|
|
|
|
- </Border>
|
|
|
|
|
-
|
|
|
|
|
- <ControlTemplate.Triggers>
|
|
|
|
|
- <!-- 悬停效果 -->
|
|
|
|
|
- <Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
- <Setter TargetName="Bd" Property="Background"
|
|
|
|
|
- Value="{StaticResource RowHoverBackground}"/>
|
|
|
|
|
- </Trigger>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 选中效果 -->
|
|
|
|
|
- <Trigger Property="IsSelected" Value="True">
|
|
|
|
|
- <Setter TargetName="Bd" Property="Background"
|
|
|
|
|
- Value="{StaticResource RowSelectedBackground}"/>
|
|
|
|
|
- <Setter Property="Foreground"
|
|
|
|
|
- Value="{StaticResource RowSelectedForeground}"/>
|
|
|
|
|
- </Trigger>
|
|
|
|
|
- </ControlTemplate.Triggers>
|
|
|
|
|
- </ControlTemplate>
|
|
|
|
|
- </Setter.Value>
|
|
|
|
|
- </Setter>
|
|
|
|
|
- </Style>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 交替行背景样式 -->
|
|
|
|
|
- <Style x:Key="AlternatingListViewItemStyle"
|
|
|
|
|
- BasedOn="{StaticResource CustomListViewItemStyle}"
|
|
|
|
|
- TargetType="ListViewItem">
|
|
|
|
|
- <Style.Triggers>
|
|
|
|
|
- <Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
|
|
|
|
- <Setter Property="Background" Value="{StaticResource NormalRowBackground}"/>
|
|
|
|
|
- </Trigger>
|
|
|
|
|
- <Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
|
|
|
|
- <Setter Property="Background" Value="{StaticResource AlternateRowBackground}"/>
|
|
|
|
|
- </Trigger>
|
|
|
|
|
- </Style.Triggers>
|
|
|
|
|
- </Style>
|
|
|
|
|
-
|
|
|
|
|
- <!-- GridView列标题样式 - 修复版 -->
|
|
|
|
|
- <Style x:Key="CustomGridViewColumnHeader" TargetType="GridViewColumnHeader">
|
|
|
|
|
- <Setter Property="Background" Value="{StaticResource HeaderBackground}"/>
|
|
|
|
|
- <Setter Property="Foreground" Value="{StaticResource HeaderForeground}"/>
|
|
|
|
|
- <Setter Property="Height" Value="40"/>
|
|
|
|
|
- <Setter Property="FontSize" Value="13"/>
|
|
|
|
|
- <Setter Property="FontWeight" Value="Bold"/>
|
|
|
|
|
- <Setter Property="BorderThickness" Value="0,0,1,0"/>
|
|
|
|
|
- <Setter Property="BorderBrush" Value="#34495E"/>
|
|
|
|
|
- <Setter Property="Cursor" Value="Hand"/>
|
|
|
|
|
- <Setter Property="HorizontalContentAlignment" Value="Left"/>
|
|
|
|
|
- <Setter Property="Padding" Value="10,0"/>
|
|
|
|
|
-
|
|
|
|
|
- <Setter Property="Template">
|
|
|
|
|
- <Setter.Value>
|
|
|
|
|
- <ControlTemplate TargetType="GridViewColumnHeader">
|
|
|
|
|
- <Grid>
|
|
|
|
|
- <Border x:Name="HeaderBorder"
|
|
|
|
|
- Background="{TemplateBinding Background}"
|
|
|
|
|
- BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
- BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
- Padding="{TemplateBinding Padding}">
|
|
|
|
|
-
|
|
|
|
|
- <Grid>
|
|
|
|
|
- <Grid.ColumnDefinitions>
|
|
|
|
|
- <ColumnDefinition Width="*"/>
|
|
|
|
|
- <ColumnDefinition Width="Auto"/>
|
|
|
|
|
- </Grid.ColumnDefinitions>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 使用ContentControl替代ContentPresenter,更可靠 -->
|
|
|
|
|
- <ContentControl x:Name="HeaderContent"
|
|
|
|
|
- Grid.Column="0"
|
|
|
|
|
- Content="{TemplateBinding Content}"
|
|
|
|
|
- ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
|
|
|
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
- VerticalAlignment="Center"
|
|
|
|
|
- Foreground="{TemplateBinding Foreground}"
|
|
|
|
|
- FontWeight="{TemplateBinding FontWeight}"
|
|
|
|
|
- FontSize="{TemplateBinding FontSize}"/>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 排序指示器 -->
|
|
|
|
|
- <Path x:Name="SortIndicator"
|
|
|
|
|
- Grid.Column="1"
|
|
|
|
|
- Width="10"
|
|
|
|
|
- Height="10"
|
|
|
|
|
- Margin="8,0,0,0"
|
|
|
|
|
- Fill="{TemplateBinding Foreground}"
|
|
|
|
|
- Visibility="Collapsed"
|
|
|
|
|
- Data="M0,8 L5,0 L10,8 Z"
|
|
|
|
|
- Stretch="Fill"/>
|
|
|
|
|
- </Grid>
|
|
|
|
|
- </Border>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 列分隔线 -->
|
|
|
|
|
- <Rectangle x:Name="Splitter"
|
|
|
|
|
- Grid.Column="0"
|
|
|
|
|
- Width="1"
|
|
|
|
|
- HorizontalAlignment="Right"
|
|
|
|
|
- VerticalAlignment="Stretch"
|
|
|
|
|
- Fill="{StaticResource GridLineBrush}"
|
|
|
|
|
- Visibility="Hidden"/>
|
|
|
|
|
- </Grid>
|
|
|
|
|
-
|
|
|
|
|
- <ControlTemplate.Triggers>
|
|
|
|
|
- <!-- 隐藏内边距列 -->
|
|
|
|
|
- <Trigger Property="Role" Value="Padding">
|
|
|
|
|
- <Setter Property="Visibility" Value="Collapsed"/>
|
|
|
|
|
- </Trigger>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 悬停效果 -->
|
|
|
|
|
- <Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
- <Setter TargetName="HeaderBorder" Property="Background" Value="#34495E"/>
|
|
|
|
|
- </Trigger>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 按下效果 -->
|
|
|
|
|
- <Trigger Property="IsPressed" Value="True">
|
|
|
|
|
- <Setter TargetName="HeaderBorder" Property="Background" Value="#1A252F"/>
|
|
|
|
|
- </Trigger>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 显示排序指示器 -->
|
|
|
|
|
- <Trigger SourceName="SortIndicator" Property="Visibility" Value="Visible">
|
|
|
|
|
- <Setter TargetName="HeaderContent" Property="Margin" Value="0,0,20,0"/>
|
|
|
|
|
- </Trigger>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 列分隔线显示 -->
|
|
|
|
|
- <MultiTrigger>
|
|
|
|
|
- <MultiTrigger.Conditions>
|
|
|
|
|
- <Condition Property="IsMouseOver" Value="True"/>
|
|
|
|
|
- <Condition Property="Role" Value="Normal"/>
|
|
|
|
|
- </MultiTrigger.Conditions>
|
|
|
|
|
- <Setter TargetName="Splitter" Property="Visibility" Value="Visible"/>
|
|
|
|
|
- </MultiTrigger>
|
|
|
|
|
- </ControlTemplate.Triggers>
|
|
|
|
|
- </ControlTemplate>
|
|
|
|
|
- </Setter.Value>
|
|
|
|
|
- </Setter>
|
|
|
|
|
- </Style>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 主ListView样式 -->
|
|
|
|
|
- <Style x:Key="CustomListViewStyle" TargetType="ListView">
|
|
|
|
|
- <Setter Property="Background" Value="White"/>
|
|
|
|
|
- <Setter Property="BorderBrush" Value="#BDC3C7"/>
|
|
|
|
|
- <Setter Property="BorderThickness" Value="1"/>
|
|
|
|
|
- <Setter Property="FontFamily" Value="Segoe UI"/>
|
|
|
|
|
- <Setter Property="AlternationCount" Value="2"/>
|
|
|
|
|
- <Setter Property="ItemContainerStyle"
|
|
|
|
|
- Value="{StaticResource AlternatingListViewItemStyle}"/>
|
|
|
|
|
-
|
|
|
|
|
- <Setter Property="Template">
|
|
|
|
|
- <Setter.Value>
|
|
|
|
|
- <ControlTemplate TargetType="ListView">
|
|
|
|
|
- <Border Background="{TemplateBinding Background}"
|
|
|
|
|
- BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
- BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
- CornerRadius="4">
|
|
|
|
|
- <ScrollViewer>
|
|
|
|
|
- <ItemsPresenter/>
|
|
|
|
|
- </ScrollViewer>
|
|
|
|
|
- </Border>
|
|
|
|
|
- </ControlTemplate>
|
|
|
|
|
- </Setter.Value>
|
|
|
|
|
- </Setter>
|
|
|
|
|
</Style>
|
|
</Style>
|
|
|
</ResourceDictionary>
|
|
</ResourceDictionary>
|