Repository navigation
Expand file tree
/
Copy pathTaskEditDialog.xaml
More file actions
277 lines (257 loc) · 14.7 KB
/
Copy pathTaskEditDialog.xaml
File metadata and controls
277 lines (257 loc) · 14.7 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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<Window x:Class="GamePrince.TaskEditDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="编辑任务" Height="680" Width="480"
Background="#0f172a" WindowStartupLocation="CenterOwner"
FontFamily="Segoe UI" Foreground="White" ResizeMode="NoResize">
<Window.Resources>
<!-- 输入框样式 (扁平风格) -->
<Style x:Key="InputTextBox" TargetType="TextBox">
<Setter Property="Background" Value="#1e293b"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="12,10"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="CaretBrush" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border x:Name="border" Background="{TemplateBinding Background}"
CornerRadius="4" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer x:Name="PART_ContentHost" Margin="0"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter TargetName="border" Property="BorderBrush" Value="#8b5cf6"/>
<Setter TargetName="border" Property="BorderThickness" Value="2"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#283548"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 下拉框样式 (扁平风格) -->
<Style x:Key="InputComboBox" TargetType="ComboBox">
<Setter Property="Background" Value="#1e293b"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="12,10"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<Border x:Name="border" Background="{TemplateBinding Background}" CornerRadius="4">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<ContentPresenter Grid.Column="0" Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
Margin="{TemplateBinding Padding}" VerticalAlignment="Center"/>
<Path Grid.Column="1" Data="M0,0 L4,4 L8,0" Stroke="#94a3b8"
StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<ToggleButton Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Background="Transparent" BorderThickness="0" Opacity="0"/>
</Grid>
</Border>
<Popup x:Name="PART_Popup" AllowsTransparency="True" IsOpen="{TemplateBinding IsDropDownOpen}"
Placement="Bottom" PopupAnimation="Slide">
<Border Background="#1e293b" CornerRadius="4" Margin="0,5,0,0">
<ScrollViewer MaxHeight="200">
<ItemsPresenter/>
</ScrollViewer>
</Border>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#283548"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 下拉框项样式 -->
<Style TargetType="ComboBoxItem">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Padding" Value="14,10"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border x:Name="border" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#334155"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="border" Property="Background" Value="#8b5cf6"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 标签样式 -->
<Style x:Key="FieldLabel" TargetType="TextBlock">
<Setter Property="Foreground" Value="#94a3b8"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontWeight" Value="Medium"/>
<Setter Property="Margin" Value="0,0,0,8"/>
</Style>
<!-- 取消按钮 (扁平风格) -->
<Style x:Key="CancelButton" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="#94a3b8"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="16,10"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border" Background="{TemplateBinding Background}"
CornerRadius="4" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#1e293b"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 保存按钮 (扁平风格) -->
<Style x:Key="SaveButton" TargetType="Button">
<Setter Property="Background" Value="#8b5cf6"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="24,10"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border" Background="{TemplateBinding Background}"
CornerRadius="4" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#a78bfa"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="border" Property="Background" Value="#7c3aed"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<!-- 装饰性顶部条 -->
<Border Background="#111827" Height="5" VerticalAlignment="Top"/>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Margin="30,30,30,30">
<!-- 标题区域 -->
<StackPanel Margin="0,0,0,30">
<TextBlock Text="编辑任务" Foreground="White" FontSize="24" FontWeight="Bold"/>
<TextBlock Text="创建或修改任务信息" Foreground="#64748b" FontSize="13" Margin="0,6,0,0"/>
</StackPanel>
<!-- 任务标题 -->
<StackPanel Margin="0,0,0,20">
<TextBlock Text="任务标题" Style="{StaticResource FieldLabel}"/>
<TextBox x:Name="TitleInput" Style="{StaticResource InputTextBox}"/>
</StackPanel>
<!-- 任务描述 -->
<StackPanel Margin="0,0,0,20">
<TextBlock Text="任务描述 (支持 Markdown)" Style="{StaticResource FieldLabel}"/>
<TextBox x:Name="DescriptionInput" Style="{StaticResource InputTextBox}"
Height="100" TextWrapping="Wrap" AcceptsReturn="True"
VerticalScrollBarVisibility="Auto"/>
</StackPanel>
<!-- 分类和里程碑 -->
<Grid Margin="0,0,0,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="15"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock Text="分类" Style="{StaticResource FieldLabel}"/>
<ComboBox x:Name="CategoryInput" Style="{StaticResource InputComboBox}">
<ComboBoxItem Content="程序" IsSelected="True"/>
<ComboBoxItem Content="美术"/>
<ComboBoxItem Content="环境"/>
<ComboBoxItem Content="文档"/>
</ComboBox>
</StackPanel>
<StackPanel Grid.Column="2">
<TextBlock Text="里程碑" Style="{StaticResource FieldLabel}"/>
<ComboBox x:Name="MilestoneInput" Style="{StaticResource InputComboBox}"
SelectedValuePath="Id">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Title}" Foreground="White"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
</Grid>
<!-- 紧急度、重要度、预计工时 -->
<Grid Margin="0,0,0,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock Text="紧急度 (1-10)" Style="{StaticResource FieldLabel}"/>
<TextBox x:Name="UrgencyInput" Style="{StaticResource InputTextBox}"/>
</StackPanel>
<StackPanel Grid.Column="2">
<TextBlock Text="重要度 (1-10)" Style="{StaticResource FieldLabel}"/>
<TextBox x:Name="ImportanceInput" Style="{StaticResource InputTextBox}"/>
</StackPanel>
<StackPanel Grid.Column="4">
<TextBlock Text="预计工时 (小时)" Style="{StaticResource FieldLabel}"/>
<TextBox x:Name="EstimateInput" Style="{StaticResource InputTextBox}"/>
</StackPanel>
</Grid>
<!-- 截止日期 -->
<StackPanel Margin="0,0,0,20">
<TextBlock Text="截止日期 (YYYY-MM-DD)" Style="{StaticResource FieldLabel}"/>
<TextBox x:Name="DueDateInput" Style="{StaticResource InputTextBox}"/>
</StackPanel>
<!-- 标签 -->
<StackPanel Margin="0,0,0,30">
<TextBlock Text="标签 (以逗号分隔)" Style="{StaticResource FieldLabel}"/>
<TextBox x:Name="TagsInput" Style="{StaticResource InputTextBox}"/>
</StackPanel>
<!-- 按钮区域 -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Content="取消" Click="Cancel_Click" Style="{StaticResource CancelButton}"/>
<Button Content="保存任务" Click="Save_Click" Style="{StaticResource SaveButton}" Margin="15,0,0,0"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
</Window>