-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskReminderWindow.xaml
More file actions
205 lines (189 loc) · 9.54 KB
/
TaskReminderWindow.xaml
File metadata and controls
205 lines (189 loc) · 9.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<Window x:Class="TimeTask.TaskReminderWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:TimeTask"
Title="{local:Loc Key=TaskReminder_WindowTitle}" Height="400" Width="500"
WindowStartupLocation="CenterScreen"
ResizeMode="NoResize"
Topmost="True"
ShowInTaskbar="False"
Background="#F5F5F5">
<Window.Resources>
<Style x:Key="ModernButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#4CAF50"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="15,8"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="4"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#45a049"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SecondaryButtonStyle" TargetType="Button" BasedOn="{StaticResource ModernButtonStyle}">
<Setter Property="Background" Value="#2196F3"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="4"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#1976D2"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DangerButtonStyle" TargetType="Button" BasedOn="{StaticResource ModernButtonStyle}">
<Setter Property="Background" Value="#F44336"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="4"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#D32F2F"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 可见性转换器 -->
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
</Window.Resources>
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 标题 -->
<TextBlock x:Name="WindowTitleText"
Grid.Row="0"
Text="{local:Loc Key=TaskReminder_Header}"
FontSize="18"
FontWeight="Bold"
Foreground="#333"
Margin="0,0,0,15"/>
<!-- 任务信息 -->
<Border Grid.Row="1"
Background="White"
CornerRadius="8"
Padding="15"
BorderBrush="#E0E0E0"
BorderThickness="1"
Margin="0,0,0,15">
<StackPanel>
<TextBlock Text="{local:Loc Key=TaskReminder_LabelTask}" FontWeight="Bold" Foreground="#666" FontSize="12"/>
<TextBlock x:Name="TaskDescriptionText"
Text="{Binding TaskDescription}"
FontSize="14"
Foreground="#333"
TextWrapping="Wrap"
Margin="0,5,0,10"/>
<TextBlock x:Name="TaskMetaLabelText" Text="{local:Loc Key=TaskReminder_LabelInactive}" FontWeight="Bold" Foreground="#666" FontSize="12"/>
<TextBlock x:Name="InactiveTimeText"
Text="{Binding InactiveTime}"
FontSize="12"
Foreground="#FF6B35"
Margin="0,2,0,0"/>
</StackPanel>
</Border>
<!-- 提醒消息和建议 -->
<ScrollViewer Grid.Row="2" VerticalScrollBarVisibility="Auto">
<StackPanel>
<TextBlock x:Name="ReminderMessageText"
Text="{Binding ReminderMessage}"
FontSize="13"
Foreground="#555"
TextWrapping="Wrap"
Margin="0,0,0,15"/>
<TextBlock Text="{local:Loc Key=TaskReminder_LabelSuggestions}"
FontWeight="Bold"
Foreground="#666"
FontSize="12"
Margin="0,0,0,8"
Visibility="{Binding HasSuggestions, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<ItemsControl x:Name="SuggestionsPanel" ItemsSource="{Binding Suggestions}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="#E8F5E8"
CornerRadius="4"
Padding="10,6"
Margin="0,2">
<TextBlock Text="{Binding}"
FontSize="12"
Foreground="#2E7D32"
TextWrapping="Wrap"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
<!-- 快速操作按钮 -->
<StackPanel Grid.Row="3"
Orientation="Horizontal"
HorizontalAlignment="Center"
Margin="0,15,0,10">
<Button x:Name="CompleteTaskButton"
Content="{local:Loc Key=TaskReminder_ButtonComplete}"
Style="{StaticResource ModernButtonStyle}"
Click="CompleteTaskButton_Click"/>
<Button x:Name="UpdateTaskButton"
Content="{local:Loc Key=TaskReminder_ButtonUpdate}"
Style="{StaticResource SecondaryButtonStyle}"
Click="UpdateTaskButton_Click"/>
<Button x:Name="DecomposeTaskButton"
Content="{local:Loc Key=TaskReminder_ButtonDecompose}"
Style="{StaticResource SecondaryButtonStyle}"
Click="DecomposeTaskButton_Click"
Visibility="{Binding CanDecompose, Converter={StaticResource BooleanToVisibilityConverter}}"/>
</StackPanel>
<!-- 底部按钮 -->
<StackPanel Grid.Row="4"
Orientation="Horizontal"
HorizontalAlignment="Right">
<Button x:Name="SnoozeButton"
Content="{local:Loc Key=TaskReminder_ButtonSnooze}"
Style="{StaticResource SecondaryButtonStyle}"
Click="SnoozeButton_Click"/>
<Button x:Name="CloseButton"
Content="{local:Loc Key=TaskReminder_ButtonClose}"
Style="{StaticResource DangerButtonStyle}"
Click="CloseButton_Click"/>
</StackPanel>
</Grid>
</Window>