-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
408 lines (391 loc) · 22.9 KB
/
MainWindow.xaml
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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<Window x:Class="ToDoApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="MainWindow" WindowStartupLocation="CenterScreen" Height="800" Width="1400"
FontFamily="Franklin Gothic Medium" Background="#FF222222" HorizontalAlignment="Center"
VerticalAlignment="Center"
mc:Ignorable="d" WindowStyle="None" MouseLeftButtonDown="Window_MouseLeftButtonDown" Icon="/MyLogo.png">
<WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="0" CornerRadius="0" CaptionHeight="0" />
</WindowChrome.WindowChrome>
<Window.Resources>
<!-- Define colors -->
<SolidColorBrush x:Key="AppleRed" Color="#FF3A2D"/>
<SolidColorBrush x:Key="AppleGreen" Color="#4CD964"/>
<SolidColorBrush x:Key="AppleOrange" Color="#FFCC00"/>
<SolidColorBrush x:Key="AppleGray" Color="#222222"/>
<SolidColorBrush x:Key="AppleBasicGray" Color="#333333"/>
<SolidColorBrush x:Key="PrimaryColor" Color="#FF3A2D"/>
<SolidColorBrush x:Key="AccentColor" Color="#4CD964"/>
<SolidColorBrush x:Key="HighlightColor" Color="#FFCC00"/>
<SolidColorBrush x:Key="TextColor" Color="#222222"/>
<SolidColorBrush x:Key="BackgroundColor" Color="#333333"/>
<Style x:Key="TextBoxStyle" TargetType="TextBox">
<Setter Property="Background" Value="{DynamicResource AppleGray}" />
<Setter Property="Foreground" Value="White" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="Margin" Value="5" />
<Setter Property="FontSize" Value="14" />
</Style>
<Style x:Key="DatePickerStyle" TargetType="DatePicker">
<Setter Property="Margin" Value="5" />
<Setter Property="Background" Value="{DynamicResource AppleGray}" />
<Setter Property="FontSize" Value="14" />
<Setter Property="BorderBrush" Value="{StaticResource AccentColor}" />
<Setter Property="BorderThickness" Value="2" />
</Style>
<Style x:Key="TimePickerStyle" TargetType="ComboBox">
<Setter Property="Background" Value="{DynamicResource AppleGray}" />
<Setter Property="Margin" Value="5" />
<Setter Property="FontSize" Value="14" />
<Setter Property="BorderBrush" Value="{StaticResource AccentColor}" />
<Setter Property="BorderThickness" Value="2" />
</Style>
<Style x:Key="BasicButtonStyle" TargetType="{x:Type Button}">
<Setter Property="Background" Value="{DynamicResource AppleGreen}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="White"/>
<Setter Property="DropShadowEffect.Color" Value="#4CD964" />
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="0,0,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="btnBasicButton"
SnapsToDevicePixels="True"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter x:Name="ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False" RecognizesAccessKey="True"
Margin="{TemplateBinding Padding}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="btnBasicButton" Property="Background"
Value="{DynamicResource AppleBasicGray}" />
<Setter TargetName="btnBasicButton" Property="Effect">
<Setter.Value>
<DropShadowEffect Color="#4CD964"/>
</Setter.Value>
</Setter>
<Setter TargetName="btnBasicButton" Property="BorderBrush"
Value="{DynamicResource AppleGray}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="btnBasicButton" Property="Background"
Value="{DynamicResource AppleGreen}" />
<Setter TargetName="btnBasicButton" Property="Effect">
<Setter.Value>
<DropShadowEffect Color="#4CD964"/>
</Setter.Value>
</Setter>
<Setter TargetName="btnBasicButton" Property="BorderThickness"
Value="1" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="LittleButtonsStyle" TargetType="{x:Type Button}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="DropShadowEffect.Color" Value="#4CD964" />
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="0,0,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="btnBasicButton"
SnapsToDevicePixels="True"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter x:Name="ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False" RecognizesAccessKey="True"
Margin="{TemplateBinding Padding}"
/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="btnBasicButton" Property="Effect">
<Setter.Value>
<DropShadowEffect Color="#4CD964"/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="btnBasicButton" Property="BorderThickness"
Value="3" />
<Setter TargetName="btnBasicButton" Property="Effect">
<Setter.Value>
<DropShadowEffect Color="#4CD964"/>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="LittleDeleteButtonsStyle" TargetType="{x:Type Button}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="DropShadowEffect.Color" Value="#FF3A2D" />
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="BorderThickness" Value="0,0,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="btnBasicButton"
SnapsToDevicePixels="True"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter x:Name="ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False" RecognizesAccessKey="True"
Margin="{TemplateBinding Padding}"
/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="btnBasicButton" Property="Effect">
<Setter.Value>
<DropShadowEffect Color="#FF3A2D"/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="btnBasicButton" Property="BorderThickness"
Value="3" />
<Setter TargetName="btnBasicButton" Property="Effect">
<Setter.Value>
<DropShadowEffect Color="#FF3A2D"/>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- DataTemplate for displaying TaskItem -->
<DataTemplate x:Key="TaskItemTemplate">
<StackPanel Orientation="Horizontal" Margin="5" Width="Auto" >
<CheckBox IsChecked="{Binding IsCompleted}"
VerticalAlignment="Center"
Margin="5,0"/>
<StackPanel>
<TextBlock Text="{Binding Description}"
Foreground="White"
FontSize="16"
Margin="5,0"/>
<TextBlock Text="{Binding RemainingTime}"
Foreground="#cccccc"
FontSize="14"
Margin="5"/>
<Button x:Name="btnDelete" Style="{DynamicResource LittleDeleteButtonsStyle}" Width="24" Height="24" BorderBrush="Transparent" Background="Transparent" Click="btnDelete_Click" HorizontalAlignment="Right" VerticalAlignment="Center" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Tag="{Binding}" Margin="10,0,5,0" Padding="0,0,0,0">
<Image x:Name="imgClose" Source="C:\Users\Marti\source\repos\EmpireChatRoom\src\images\close-box.png" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" Height="26" Width="26"/>
</Button>
</StackPanel>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="CompleteTaskItemTemplate">
<StackPanel Orientation="Horizontal" Margin="5" Width="Auto" Background="{DynamicResource AppleGray}">
<CheckBox IsChecked="True"
VerticalAlignment="Center"
Margin="5,0"/>
<StackPanel>
<TextBlock Text="{Binding Description}"
Foreground="White"
FontSize="16"
Margin="5,0"/>
<TextBlock Text="{Binding RemainingTime}"
Foreground="#cccccc"
FontSize="14"
Margin="5,0"/>
<Button x:Name="btnDelete" Style="{DynamicResource LittleDeleteButtonsStyle}" Width="24" Height="24" BorderBrush="Transparent" Background="Transparent" Click="btnDelete_Click" HorizontalAlignment="Right" VerticalAlignment="Center" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Tag="{Binding}" Padding="0,0,0,0">
<Image x:Name="imgClose" Source="C:\Users\Marti\source\repos\EmpireChatRoom\src\images\close-box.png" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" Height="26" Width="26"/>
</Button>
</StackPanel>
</StackPanel>
</DataTemplate>
</Window.Resources>
<Grid Background="{StaticResource AppleGray}" Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="50"/>
<RowDefinition Height="*" />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Margin="5,0,5,0">
<Label Content="T0D0L1st"
Height="30"
Foreground="White"
FontSize="14"
Background="{x:Null}"/>
<Label Content="APP from Martin Švanda"
Height="40"
Foreground="White"
FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
<Button x:Name="btnMin" Style="{DynamicResource LittleButtonsStyle}" Width="24" Height="24" BorderBrush="{x:Null}" Background="{x:Null}" Click="btnMin_Click" Foreground="{x:Null}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Padding="0,0,0,0">
<Image x:Name="imgMin" Source="C:\Users\Marti\source\repos\EmpireChatRoom\src\images\chevron-down-box.png" Stretch="Uniform" Height="26" Width="26" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Button>
<Button x:Name="btnMax" Style="{DynamicResource LittleButtonsStyle}" Width="24" Height="24" BorderBrush="Transparent" Background="Transparent" Click="btnMax_Click" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Padding="0,0,0,0">
<Image x:Name="imgMax" Source="C:\Users\Marti\source\repos\EmpireChatRoom\src\images\checkbox-intermediate.png" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" Height="26" Width="26"/>
</Button>
<Button x:Name="btnClose" Style="{DynamicResource LittleButtonsStyle}" Width="24" Height="24" BorderBrush="Transparent" Background="Transparent" Click="btnClose_Click" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Padding="0,0,0,0">
<Image x:Name="imgClose" Source="C:\Users\Marti\source\repos\EmpireChatRoom\src\images\close-box.png" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" Height="26" Width="26"/>
</Button>
</StackPanel>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Header -->
<!-- Input Section -->
<Grid Grid.Column="0" Grid.Row="0" VerticalAlignment="Center">
<TextBox x:Name="TaskInput"
Style="{StaticResource TextBoxStyle}"
Width="Auto"
TextChanged="TaskInput_TextChanged"/>
<TextBlock x:Name="PlaceholderTextBlock"
Text="Enter a new task..."
Foreground="Gray"
Margin="15,5,0,0"
VerticalAlignment="Center"
HorizontalAlignment="Left"
IsHitTestVisible="False"
Visibility="Visible"/>
</Grid>
<Grid Grid.Column="1" Grid.Row="0" VerticalAlignment="Center">
<Grid Grid.Column="0" Margin="0,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.4*" />
<ColumnDefinition Width="0.2*" />
<ColumnDefinition Width="0.4*" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Margin="10,0,10,0">
<DatePicker x:Name="TaskDatePicker"
Style="{StaticResource DatePickerStyle}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Foreground="{DynamicResource AppleGray}"
BorderThickness="5,0,5,0"
Margin="10,0,10,0"/>
</Grid>
<Grid Grid.Column="1" Margin="10,0,10,0"/>
<Grid Grid.Column="2" Margin="10,0,10,0">
<ComboBox x:Name="TaskTimePicker"
Style="{StaticResource TimePickerStyle}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Background="{DynamicResource AppleGray}"
BorderThickness="5,0,5,0"
Margin="10,0,10,0"
>
<ComboBoxItem Content="00:00" />
<ComboBoxItem Content="01:00" />
<ComboBoxItem Content="02:00" />
<ComboBoxItem Content="03:00" />
<ComboBoxItem Content="04:00" />
<ComboBoxItem Content="05:00" />
<ComboBoxItem Content="06:00" />
<ComboBoxItem Content="07:00" />
<ComboBoxItem Content="08:00" />
<ComboBoxItem Content="09:00" />
<ComboBoxItem Content="10:00" />
<ComboBoxItem Content="11:00" />
<ComboBoxItem Content="12:00" />
<ComboBoxItem Content="13:00" />
<ComboBoxItem Content="14:00" />
<ComboBoxItem Content="15:00" />
<ComboBoxItem Content="16:00" />
<ComboBoxItem Content="17:00" />
<ComboBoxItem Content="18:00" />
<ComboBoxItem Content="19:00" />
<ComboBoxItem Content="20:00" />
<ComboBoxItem Content="21:00" />
<ComboBoxItem Content="22:00" />
<ComboBoxItem Content="23:00" />
</ComboBox>
</Grid>
</Grid>
</Grid>
<Grid Grid.Column="2" Grid.Row="0" VerticalAlignment="Center" Margin="0,0,5,0">
<Button x:Name="AddTaskButton"
Content="Add Task"
Style="{DynamicResource BasicButtonStyle}"
Click="AddTaskButton_Click"
Width="Auto"
Height="Auto"
Background="{DynamicResource AppleGray}"
Padding="10,10,10,10"
Margin="10,0,0,0"/>
</Grid>
</Grid>
<Grid Grid.Row="2">
<!-- Task List -->
<ListBox x:Name="TaskListBox"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
ItemsSource="{Binding Tasks}"
ItemTemplate="{StaticResource TaskItemTemplate}"
SelectedItem="{Binding SelectedTask, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Background="Transparent"
Foreground="White"
BorderBrush="Transparent"
Margin="0,10,0,10"/>
<!-- Completed Task Button -->
<ListBox x:Name="CompletedTaskListBox"
Grid.Row="2"
Background="{DynamicResource AppleGray}"
Foreground="White"
BorderBrush="Transparent"
Margin="0,10,0,10"
Visibility="Collapsed"
ItemTemplate="{StaticResource CompleteTaskItemTemplate}"/>
<!-- Show Completed Tasks Button -->
</Grid>
<Grid Grid.Row="3" Margin="10" Height="40">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="300"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="1">
<Button x:Name="ShowCompletedTasksButton"
Content="Show Completed"
Background="{DynamicResource AppleGray}"
Style="{DynamicResource BasicButtonStyle}"
Width="Auto"
Height="Auto"
Click="ShowCompletedTasksButton_Click"
Margin="5,0,0,0" />
</Grid>
<!-- Footer -->
<TextBlock Text="Tasks will appear here."
Grid.Row="2"
FontSize="14"
Foreground="White"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</Grid>
</Window>