跳到主要内容

github/tai

公开

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

浏览文件

ChartsItemTypeCard.xaml

117 行 · 7.1 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.Charts"
4 xmlns:base="clr-namespace:UI.Controls.Base">
5 <Style TargetType="{x:Type local:ChartsItemTypeCard}">
6 <Setter Property="SnapsToDevicePixels"
7 Value="true" />
8
9 <Setter Property="Background" Value="Transparent"/>
10 <Setter Property="Margin" Value="5"/>
11
12 <Setter Property="Template">
13 <Setter.Value>
14 <ControlTemplate TargetType="{x:Type local:ChartsItemTypeCard}">
15 <Grid >
16 <Border x:Name="Normal" CornerRadius="12">
17 <Border.Effect>
18 <DropShadowEffect RenderingBias="Performance" Color="{DynamicResource ThemeColor}" BlurRadius="17" Direction="0" ShadowDepth="0" Opacity="0"/>
19 </Border.Effect>
20 <Border x:Name="Border" BorderBrush="Transparent" BorderThickness="2" Margin="0" Background="{DynamicResource StandardBackgroundBrush}" CornerRadius="12" Width="150" Height="150" >
21
22 <Border.Clip>
23 <RectangleGeometry RadiusX="12" RadiusY="12" Rect="0,0,150,150"/>
24 </Border.Clip>
25 <!--<Border.RenderTransform>
26
27 </Border.RenderTransform>-->
28 <Grid>
29 <Rectangle
30 x:Name="ValueBlockObj"
31
32
33 HorizontalAlignment="Center"
34 VerticalAlignment="Center"
35 Margin="0"
36 RenderTransformOrigin="0.5,0.5"
37 Fill="{DynamicResource ThemeBrush}"
38
39 >
40 <!--<Rectangle.Effect>
41 <BlurEffect RenderOptions.BitmapScalingMode="LowQuality" Radius="35" RenderingBias="Performance"/>
42 </Rectangle.Effect>-->
43 <!--<Rectangle.Fill>
44 <LinearGradientBrush RenderOptions.BitmapScalingMode="LowQuality" EndPoint="2,1" StartPoint="-2,0">
45 <GradientStop Color="White"/>
46 <GradientStop Color="#ff305b" Offset="1"/>
47 </LinearGradientBrush>
48 </Rectangle.Fill>-->
49 <Rectangle.RenderTransform>
50 <ScaleTransform ScaleX="3" ScaleY="3" CenterX="0" CenterY="0"/>
51 </Rectangle.RenderTransform>
52 </Rectangle>
53 <!--<Border VerticalAlignment="Center" HorizontalAlignment="Center">-->
54 <Image x:Name="IconObj" Width="25" HorizontalAlignment="Center" VerticalAlignment="Center" RenderOptions.BitmapScalingMode="LowQuality"/>
55 <!--</Border>-->
56
57 <TextBlock x:Name="NameTextObj" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ChartsItemTypeCard}}, Path=Data.Name}" Foreground="{DynamicResource WhiteBgTextBrush}" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="10"/>
58
59 <Border VerticalAlignment="Top" CornerRadius="5" Padding="5" HorizontalAlignment="Left" Margin="10" >
60 <Border.Background>
61 <SolidColorBrush Color="{DynamicResource ThemeColor}" Opacity="0.7"/>
62 </Border.Background>
63 <TextBlock x:Name="ValueTextObj" Foreground="White" FontSize="12" />
64
65 </Border>
66
67 </Grid>
68
69 </Border>
70 </Border>
71
72 <base:Placeholder x:Name="Loading" Visibility="Collapsed" CornerRadius="12" Width="150" Height="150"/>
73
74 <VisualStateManager.VisualStateGroups>
75 <VisualStateGroup x:Name="CommonStates">
76 <VisualStateGroup.Transitions>
77 <VisualTransition GeneratedDuration="0:0:.3" />
78 <VisualTransition GeneratedDuration="0"
79 To="Pressed" />
80 </VisualStateGroup.Transitions>
81 <VisualState x:Name="NormalState" />
82 <VisualState x:Name="MouseOver">
83 <Storyboard >
84 <ColorAnimation Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
85 Storyboard.TargetName="Border" To="{DynamicResource ThemeColor}" >
86 <ColorAnimation.EasingFunction>
87 <CubicEase EasingMode="EaseInOut"/>
88 </ColorAnimation.EasingFunction>
89 </ColorAnimation>
90
91 <DoubleAnimation Storyboard.TargetProperty="(Border.Effect).(DropShadowEffect.Opacity)"
92 Storyboard.TargetName="Normal" To="0.3" >
93 <DoubleAnimation.EasingFunction>
94 <CubicEase EasingMode="EaseInOut"/>
95 </DoubleAnimation.EasingFunction>
96 </DoubleAnimation>
97
98
99 </Storyboard>
100 </VisualState>
101 <VisualState x:Name="Pressed">
102
103 </VisualState>
104 </VisualStateGroup>
105 </VisualStateManager.VisualStateGroups>
106 </Grid>
107 <ControlTemplate.Triggers>
108 <Trigger Property="IsLoading" Value="True">
109 <Setter TargetName="Loading" Property="Visibility" Value="Visible"/>
110 <Setter TargetName="Normal" Property="Visibility" Value="Hidden"/>
111 </Trigger>
112 </ControlTemplate.Triggers>
113 </ControlTemplate>
114 </Setter.Value>
115 </Setter>
116 </Style>
117</ResourceDictionary>