109 lines
5.1 KiB
XML
109 lines
5.1 KiB
XML
<ResourceDictionary
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:controls="clr-namespace:WPFluent.Controls"
|
|
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
<system:Double x:Key="ListViewItemMinHeight">32</system:Double>
|
|
|
|
<ControlTemplate TargetType="{x:Type controls:ListViewItem}" x:Key="NullViewItemTemplate">
|
|
<Border
|
|
Background="Transparent"
|
|
BorderThickness="1"
|
|
CornerRadius="{TemplateBinding Border.CornerRadius}"
|
|
Margin="0"
|
|
Padding="0"
|
|
x:Name="Border">
|
|
<Grid>
|
|
<ContentPresenter Margin="{TemplateBinding Padding}" />
|
|
<Rectangle
|
|
Fill="{DynamicResource SystemFillColorAttentionBrush}"
|
|
Height="18"
|
|
HorizontalAlignment="Left"
|
|
Margin="0"
|
|
RadiusX="2"
|
|
RadiusY="2"
|
|
VerticalAlignment="Center"
|
|
Visibility="Collapsed"
|
|
Width="3"
|
|
x:Name="ActiveRectangle" />
|
|
</Grid>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="IsEnabled" Value="True" />
|
|
<Condition Property="IsMouseOver" Value="True" />
|
|
</MultiTrigger.Conditions>
|
|
<Setter Property="Background" TargetName="Border" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
|
|
</MultiTrigger>
|
|
<Trigger Property="IsSelected" Value="True">
|
|
<Setter Property="Visibility" TargetName="ActiveRectangle" Value="Visible" />
|
|
<Setter Property="Background" TargetName="Border" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
|
|
<ControlTemplate TargetType="{x:Type controls:ListViewItem}" x:Key="GridViewItemTemplate">
|
|
<Border
|
|
Background="Transparent"
|
|
BorderBrush="{TemplateBinding Border.BorderBrush}"
|
|
BorderThickness="{TemplateBinding Border.BorderThickness}"
|
|
CornerRadius="{TemplateBinding Border.CornerRadius}"
|
|
Margin="0"
|
|
Padding="0"
|
|
x:Name="Border">
|
|
<Grid>
|
|
<controls:GridViewRowPresenter
|
|
Columns="{TemplateBinding GridView.ColumnCollection}"
|
|
Content="{TemplateBinding ContentControl.Content}"
|
|
Margin="{TemplateBinding Padding}"
|
|
VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" />
|
|
<Rectangle
|
|
Fill="{DynamicResource SystemFillColorAttentionBrush}"
|
|
Height="18"
|
|
HorizontalAlignment="Left"
|
|
Margin="0"
|
|
RadiusX="2"
|
|
RadiusY="2"
|
|
VerticalAlignment="Center"
|
|
Visibility="Collapsed"
|
|
Width="3"
|
|
x:Name="ActiveRectangle" />
|
|
</Grid>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="IsEnabled" Value="True" />
|
|
<Condition Property="IsMouseOver" Value="True" />
|
|
</MultiTrigger.Conditions>
|
|
<Setter Property="Background" TargetName="Border" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
|
|
</MultiTrigger>
|
|
<Trigger Property="IsSelected" Value="True">
|
|
<Setter Property="Visibility" TargetName="ActiveRectangle" Value="Visible" />
|
|
<Setter Property="Background" TargetName="Border" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
|
|
<Style TargetType="{x:Type controls:ListViewItem}" x:Key="ListViewItemStyle">
|
|
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Border.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
|
|
<Setter Property="Margin" Value="0,0,0,2" />
|
|
<Setter Property="Padding" Value="4" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Path=ViewState, RelativeSource={RelativeSource AncestorType={x:Type ListView}}}" Value="Default">
|
|
<Setter Property="Template" Value="{DynamicResource NullViewItemTemplate}" />
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Path=ViewState, RelativeSource={RelativeSource AncestorType={x:Type ListView}}}" Value="GridView">
|
|
<Setter Property="Template" Value="{DynamicResource GridViewItemTemplate}" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<Style BasedOn="{StaticResource ListViewItemStyle}" TargetType="{x:Type controls:ListViewItem}" />
|
|
|
|
</ResourceDictionary>
|