跳到主要内容

github/tai

公开

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

浏览文件

DatePickerBarItem.xaml

78 行 · 4.5 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.DatePickerBar"
4 xmlns:base="clr-namespace:UI.Controls.Base">
5 <Style TargetType="{x:Type local:DatePickerBarItem}">
6 <Setter Property="SnapsToDevicePixels"
7 Value="true" />
8 <Setter Property="Cursor" Value="Hand"/>
9
10 <Setter Property="Background" Value="Transparent"/>
11 <Setter Property="Template">
12 <Setter.Value>
13 <ControlTemplate TargetType="{x:Type local:DatePickerBarItem}">
14 <Border>
15
16
17 <Grid Margin="2">
18
19 <Border x:Name="Bg" Background="{DynamicResource DatePickerItemBgBrush}" Width="45" Height="45" CornerRadius="25">
20 <TextBlock x:Name="Text" Foreground="{DynamicResource DefaultTextBrush}" Text="{TemplateBinding Title}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
21 </Border>
22 </Grid>
23 <VisualStateManager.VisualStateGroups>
24 <VisualStateGroup x:Name="CommonStates">
25 <VisualStateGroup.Transitions>
26 <VisualTransition GeneratedDuration="0:0:0.18" />
27 <VisualTransition GeneratedDuration="0"
28 To="Pressed" />
29 </VisualStateGroup.Transitions>
30 <VisualState x:Name="Normal" />
31 <VisualState x:Name="MouseOver">
32 <Storyboard>
33 <ColorAnimation Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
34 Storyboard.TargetName="Bg" To="{DynamicResource HoverBackgroundColor}">
35 <ColorAnimation.EasingFunction>
36 <CubicEase EasingMode="EaseIn"/>
37 </ColorAnimation.EasingFunction>
38 </ColorAnimation>
39 <ColorAnimation Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)"
40 Storyboard.TargetName="Text" To="#ffffff">
41 <ColorAnimation.EasingFunction>
42 <CubicEase EasingMode="EaseIn"/>
43 </ColorAnimation.EasingFunction>
44 </ColorAnimation>
45 <!--<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
46 Storyboard.TargetName="Bg" >
47 <EasingColorKeyFrame KeyTime="0"
48 Value="#192B20D9"/>
49
50 </ColorAnimationUsingKeyFrames>-->
51
52 </Storyboard>
53 </VisualState>
54 <VisualState x:Name="Pressed">
55
56 </VisualState>
57 </VisualStateGroup>
58 </VisualStateManager.VisualStateGroups>
59 </Border>
60 <ControlTemplate.Triggers>
61 <Trigger Property="IsSelected"
62 Value="True">
63 <Setter TargetName="Bg" Property="Background" Value="{DynamicResource ThemeBrush}"/>
64 <Setter TargetName="Text" Property="Foreground" Value="white"/>
65
66 </Trigger>
67 <Trigger Property="IsDisabled"
68 Value="True">
69 <Setter TargetName="Bg" Property="Background" Value="Transparent"/>
70 <Setter TargetName="Text" Property="Foreground" Value="#ccc"/>
71
72 </Trigger>
73 </ControlTemplate.Triggers>
74 </ControlTemplate>
75 </Setter.Value>
76 </Setter>
77 </Style>
78</ResourceDictionary>