123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <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">
- <Style TargetType="{x:Type ListBox}">
- <Setter Property="Foreground" Value="{DynamicResource FG_Black}"/>
- <Setter Property="FontFamily" Value="Arial"/>
- <Setter Property="FontSize" Value="12"/>
- <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
- <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
- <Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
- <Setter Property="VerticalContentAlignment" Value="top"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBox}">
- <Border x:Name="Bd" SnapsToDevicePixels="true">
- <ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
- <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
- </ScrollViewer>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false"/>
- <Trigger Property="IsGrouping" Value="true">
- <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style TargetType="{x:Type ListBoxItem}">
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Margin" Value="0"/>
- <Setter Property="Padding" Value="0"/>
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="Rectangle.StrokeThickness" Value="3"/>
- <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
- <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border x:Name="Bd" SnapsToDevicePixels="true">
- <Grid>
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Cursor="Hand" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
- <Rectangle x:Name="Highlight" StrokeThickness="{TemplateBinding Rectangle.StrokeThickness}" Opacity="0"/>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="true">
- <Setter Property="Stroke" TargetName="Highlight" Value="Orange"/>
- <Setter Property="Opacity" TargetName="Highlight" Value="1"/>
- <Setter Property="Foreground" Value="{DynamicResource FG_Black}"/>
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="Sepcial_ListBoxItem" TargetType="{x:Type ListBoxItem}">
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Margin" Value="0"/>
- <Setter Property="Padding" Value="0"/>
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
- <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border x:Name="Bd" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
- <Grid>
- <Border x:Name="Highlight" BorderBrush="Black" BorderThickness="0" Background="{DynamicResource Listview_BG_Highlight}" Opacity="0"/>
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Cursor="Hand" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
- </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="{DynamicResource FG_White}"/>
- <Setter Property="Margin" TargetName="Highlight" Value="0,0,1,1"/>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Opacity" TargetName="Highlight" Value="0.8"/>
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="ListBox.AlternationIndex" Value="0">
- <Setter Property="Background" Value="{DynamicResource Listview_BG_First}"/>
- </Trigger>
- <Trigger Property="ListBox.AlternationIndex" Value="1">
- <Setter Property="Background" Value="{DynamicResource Listview_BG_Second}"/>
- </Trigger>
- </Style.Triggers>
- </Style>
-
- <Style x:Key="NoSelection_ListBoxItem" TargetType="{x:Type ListBoxItem}">
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Margin" Value="0"/>
- <Setter Property="Padding" Value="0"/>
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="Rectangle.StrokeThickness" Value="3"/>
- <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
- <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border x:Name="Bd" SnapsToDevicePixels="true">
- <Grid>
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Cursor="Hand" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
- <Rectangle x:Name="Highlight" StrokeThickness="{TemplateBinding Rectangle.StrokeThickness}" Opacity="0"/>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="true">
- <Setter Property="Stroke" TargetName="Highlight" Value="Transparent"/>
- <Setter Property="Opacity" TargetName="Highlight" Value="1"/>
- <Setter Property="Foreground" Value="{DynamicResource FG_Black}"/>
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|