跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

浏览文件

BaseListItem.xaml

85 行 · 5.3 KB历史下载
1<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3 xmlns:local="clr-namespace:UI.Controls.List"
4 xmlns:base="clr-namespace:UI.Controls.Base"
5 xmlns:sys="clr-namespace:System;assembly=mscorlib">
6 <Style TargetType="{x:Type local:BaseListItem}">
7 <Setter Property="SnapsToDevicePixels"
8 Value="true" />
9 <Setter Property="UseLayoutRounding" Value="True"/>
10
11 <!--<Setter Property="MinWidth" Value="150"/>-->
12 <Setter Property="Height" Value="35"/>
13 <Setter Property="Margin" Value="0,10,0,0"/>
14
15 <Setter Property="Background" Value="Transparent"/>
16 <Setter Property="Template">
17 <Setter.Value>
18 <ControlTemplate TargetType="{x:Type local:BaseListItem}">
19 <Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
20
21 <Border BorderBrush="#f3f3f3" BorderThickness="0" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" x:Name="BoxBorder" CornerRadius="4" Background="{DynamicResource BaseListItemBgBrush}" >
22 <Grid VerticalAlignment="Center" Margin="10,0">
23 <Grid.ColumnDefinitions>
24 <ColumnDefinition Width="9*"/>
25 <ColumnDefinition Width="1*"/>
26 </Grid.ColumnDefinitions>
27 <TextBlock Text="{TemplateBinding Text}"/>
28 </Grid>
29
30 </Border>
31 <Border x:Name="Shadow" BorderBrush="{Binding ElementName=BoxBorder,Path=BorderBrush}" BorderThickness="{Binding ElementName=BoxBorder,Path=BorderThickness}" Panel.ZIndex="-1" Width="{Binding ElementName=BoxBorder,Path=ActualWidth}" Height="{Binding ElementName=BoxBorder,Path=ActualHeight}" CornerRadius="{Binding ElementName=BoxBorder,Path=CornerRadius}" Background="{Binding ElementName=BoxBorder,Path=Background}">
32 <Border.Effect>
33 <DropShadowEffect BlurRadius="5" ShadowDepth="2" Direction="315" Color="#ccc" Opacity=".05"/>
34 </Border.Effect>
35 </Border>
36
37 <VisualStateManager.VisualStateGroups>
38 <VisualStateGroup x:Name="CommonStates">
39 <VisualStateGroup.Transitions>
40 <VisualTransition GeneratedDuration="0:0:0.18" />
41 <VisualTransition GeneratedDuration="0"
42 To="Pressed" />
43 </VisualStateGroup.Transitions>
44 <VisualState x:Name="Normal" />
45 <VisualState x:Name="MouseOver">
46 <Storyboard>
47 <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Effect).(DropShadowEffect.Color)"
48 Storyboard.TargetName="Shadow">
49 <EasingColorKeyFrame KeyTime="0"
50 Value="{DynamicResource ThemeColor}"/>
51 </ColorAnimationUsingKeyFrames>
52 <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
53 Storyboard.TargetName="BoxBorder">
54 <EasingColorKeyFrame KeyTime="0"
55 Value="{DynamicResource BaseListItemHoverBgColor}" />
56 </ColorAnimationUsingKeyFrames>
57 <!--<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Button.Foreground).(SolidColorBrush.Color)"
58 >
59 <EasingColorKeyFrame KeyTime="0"
60 Value="White" />
61 </ColorAnimationUsingKeyFrames>-->
62 </Storyboard>
63 </VisualState>
64 <VisualState x:Name="Pressed">
65
66 </VisualState>
67 </VisualStateGroup>
68 </VisualStateManager.VisualStateGroups>
69
70 </Grid>
71 <ControlTemplate.Triggers>
72 <Trigger Property="IsSelected" Value="True">
73 <Setter TargetName="BoxBorder" Property="Background" Value="{DynamicResource ThemeBrush}"/>
74 <Setter Property="Foreground" Value="White"/>
75
76 </Trigger>
77 <!--<Trigger Property="IsMouseOver" Value="True">
78 <Setter TargetName="BoxBorder" Property="BorderThickness" Value="0"/>
79 </Trigger>-->
80 </ControlTemplate.Triggers>
81 </ControlTemplate>
82 </Setter.Value>
83 </Setter>
84 </Style>
85</ResourceDictionary>