-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
393 lines (362 loc) · 22.9 KB
/
MainWindow.xaml
File metadata and controls
393 lines (362 loc) · 22.9 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
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
<Window x:Class="TodoExport.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Microsoft To Do Export"
Height="750" Width="950"
MinHeight="650" MinWidth="800"
Background="#F5F5F5"
WindowStartupLocation="CenterScreen"
Loaded="Window_Loaded">
<Window.Resources>
<!-- Primary Blue Button -->
<Style x:Key="PrimaryButton" TargetType="Button">
<Setter Property="Background" Value="#0078D4"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Padding" Value="24,14"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border" Background="{TemplateBinding Background}"
CornerRadius="6" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#106EBE"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="border" Property="Background" Value="#CCCCCC"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Secondary/Outline Button -->
<Style x:Key="SecondaryButton" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="#0078D4"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Padding" Value="16,10"/>
<Setter Property="BorderThickness" Value="1.5"/>
<Setter Property="BorderBrush" Value="#0078D4"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="6" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#E8F4FD"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Ghost Button -->
<Style x:Key="GhostButton" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="#666"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Padding" Value="12,8"/>
<Setter Property="BorderThickness" Value="0"/>
<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="#E8E8E8"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- List Item Checkbox Style -->
<Style x:Key="ListCheckBox" TargetType="CheckBox">
<Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="#333"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Padding" Value="12,14"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<Border x:Name="border" Background="White" CornerRadius="6"
Padding="{TemplateBinding Padding}" Margin="0,2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border x:Name="checkBorder" Width="20" Height="20"
CornerRadius="4" BorderThickness="2"
BorderBrush="#CCC" Background="White"
VerticalAlignment="Center">
<TextBlock x:Name="checkMark" Text="✓"
FontSize="14" FontWeight="Bold"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Visibility="Collapsed"/>
</Border>
<ContentPresenter Grid.Column="1" Margin="12,0,0,0"
VerticalAlignment="Center"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="checkBorder" Property="Background" Value="#0078D4"/>
<Setter TargetName="checkBorder" Property="BorderBrush" Value="#0078D4"/>
<Setter TargetName="checkMark" Property="Visibility" Value="Visible"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#F8F8F8"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Code Box for Device Code -->
<Style x:Key="CodeBox" TargetType="Border">
<Setter Property="Background" Value="#1A1A2E"/>
<Setter Property="CornerRadius" Value="8"/>
<Setter Property="Padding" Value="24,16"/>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Header -->
<Border Grid.Row="0" Background="White" Padding="28,18" BorderBrush="#E0E0E0" BorderThickness="0,0,0,1">
<Grid>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="✅" FontSize="28" VerticalAlignment="Center"/>
<StackPanel Margin="14,0,0,0">
<TextBlock x:Name="AppTitleText" Text="Microsoft To Do Export" FontSize="22" FontWeight="SemiBold" Foreground="#1A1A1A"/>
<TextBlock x:Name="AppSubtitleText" Text="Back up your tasks in various formats" FontSize="12" Foreground="#888" Margin="0,2,0,0"/>
</StackPanel>
</StackPanel>
<!-- Right Side: Language Switch + User Info -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
<!-- Language Switch -->
<StackPanel Orientation="Horizontal" Margin="0,0,20,0">
<Button x:Name="LanguageDEButton" Content="DE"
Style="{StaticResource SecondaryButton}"
FontSize="12" Padding="14,8"
Click="LanguageDEButton_Click"/>
<Button x:Name="LanguageENButton" Content="EN"
Style="{StaticResource PrimaryButton}"
FontSize="12" Padding="14,8" Margin="8,0,0,0"
Click="LanguageENButton_Click"/>
</StackPanel>
<!-- User Info -->
<StackPanel x:Name="UserPanel" Orientation="Horizontal"
VerticalAlignment="Center" Visibility="Collapsed">
<Border Width="38" Height="38" CornerRadius="19" Background="#0078D4">
<TextBlock x:Name="UserInitial" Text="M" FontSize="16" FontWeight="SemiBold"
Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<StackPanel Margin="12,0,0,0" VerticalAlignment="Center">
<TextBlock x:Name="UserNameText" FontSize="14" FontWeight="SemiBold" Foreground="#1A1A1A"/>
<TextBlock x:Name="LoggedInText" Text="Signed in" FontSize="11" Foreground="#107C10"/>
</StackPanel>
<Button x:Name="SignOutButton" Content="Sign out"
Style="{StaticResource GhostButton}"
Margin="20,0,0,0"
Click="SignOutButton_Click"/>
</StackPanel>
</StackPanel>
</Grid>
</Border>
<!-- Main Content -->
<Grid Grid.Row="1">
<!-- LOGIN SECTION -->
<Border x:Name="LoginSection" Background="White" Margin="40" CornerRadius="12"
VerticalAlignment="Center" HorizontalAlignment="Center" Padding="60,50">
<StackPanel HorizontalAlignment="Center" MaxWidth="400">
<Border Width="80" Height="80" CornerRadius="40" Background="#E8F4FD" Margin="0,0,0,24">
<TextBlock Text="🔐" FontSize="36" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBlock x:Name="SignInTitleText" Text="Sign in with Microsoft"
FontSize="24" FontWeight="SemiBold"
HorizontalAlignment="Center" Foreground="#1A1A1A"/>
<TextBlock x:Name="SignInSubtitleText" Text="Sign in to back up and export
your To-Do lists."
FontSize="14" Foreground="#666"
HorizontalAlignment="Center" Margin="0,12,0,32"
TextWrapping="Wrap" TextAlignment="Center" LineHeight="22"/>
<Button x:Name="SignInButton"
Content="Sign in"
Style="{StaticResource PrimaryButton}"
FontSize="15" Padding="40,16"
HorizontalAlignment="Center"
Click="SignInButton_Click"/>
<TextBlock x:Name="SignInHintText" Text="Supports Outlook.com, Hotmail, Live, and work accounts"
FontSize="11" Foreground="#AAA"
HorizontalAlignment="Center" Margin="0,20,0,0"/>
</StackPanel>
</Border>
<!-- DEVICE CODE SECTION -->
<Border x:Name="DeviceCodeSection" Background="White" Margin="40" CornerRadius="12"
VerticalAlignment="Center" HorizontalAlignment="Center" Padding="60,50" Visibility="Collapsed">
<StackPanel HorizontalAlignment="Center" MaxWidth="420">
<ProgressBar IsIndeterminate="True" Height="3" Width="200"
Foreground="#0078D4" Margin="0,0,0,24"/>
<TextBlock x:Name="BrowserLoginText" Text="Browser sign-in"
FontSize="22" FontWeight="SemiBold"
HorizontalAlignment="Center" Foreground="#1A1A1A"/>
<TextBlock x:Name="BrowserLoginHintText" Text="A browser has been opened. Enter
this code there to sign in:"
FontSize="14" Foreground="#666"
HorizontalAlignment="Center" Margin="0,12,0,24"
TextWrapping="Wrap" TextAlignment="Center" LineHeight="22"/>
<!-- Code Display -->
<Border Style="{StaticResource CodeBox}" HorizontalAlignment="Center">
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="DeviceCodeText" Text="XXXXXXXX"
FontSize="28" FontWeight="Bold" FontFamily="Consolas"
Foreground="#4FC3F7" VerticalAlignment="Center"/>
<Button x:Name="CopyCodeButton" Content="📋"
Background="Transparent" BorderThickness="0"
Foreground="#666" FontSize="18"
Margin="16,0,0,0" Cursor="Hand"
ToolTip="Copy code"
Click="CopyCodeButton_Click"/>
</StackPanel>
</Border>
<Button x:Name="OpenBrowserButton"
Content="Open browser again"
Style="{StaticResource SecondaryButton}"
FontSize="12" Padding="16,8" Margin="0,20,0,0"
HorizontalAlignment="Center"
Click="OpenBrowserButton_Click"/>
<Button x:Name="CancelLoginButton" Content="Cancel"
Style="{StaticResource GhostButton}"
HorizontalAlignment="Center" Margin="0,16,0,0"
Click="CancelLoginButton_Click"/>
</StackPanel>
</Border>
<!-- EXPORT SECTION -->
<Grid x:Name="ExportSection" Margin="28,20" Visibility="Collapsed">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" MinWidth="350"/>
<ColumnDefinition Width="320"/>
</Grid.ColumnDefinitions>
<!-- Left: List Selection -->
<Border Grid.Column="0" Background="White" CornerRadius="10" Margin="0,0,14,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Header -->
<Border Grid.Row="0" Padding="20,16" BorderBrush="#EEE" BorderThickness="0,0,0,1">
<Grid>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock x:Name="SelectListsText" Text="Select lists" FontSize="16" FontWeight="SemiBold" Foreground="#1A1A1A" VerticalAlignment="Center"/>
<TextBlock x:Name="ListCount" FontSize="13" Foreground="#0078D4"
VerticalAlignment="Center" Margin="10,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="SelectAllButton" Content="All"
Style="{StaticResource PrimaryButton}"
FontSize="12" Padding="14,8"
Click="SelectAllButton_Click"/>
<Button x:Name="SelectNoneButton" Content="None"
Style="{StaticResource SecondaryButton}"
FontSize="12" Padding="14,8" Margin="8,0,0,0"
Click="SelectNoneButton_Click"/>
<Button x:Name="RefreshButton" Content="🔄"
Style="{StaticResource GhostButton}"
FontSize="14" Padding="8,6" Margin="8,0,0,0"
ToolTip="Refresh lists"
Click="RefreshButton_Click"/>
</StackPanel>
</Grid>
</Border>
<!-- List -->
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Padding="12,8">
<StackPanel x:Name="ListsPanel"/>
</ScrollViewer>
</Grid>
</Border>
<!-- Right: Export Options -->
<Border Grid.Column="1" Background="White" CornerRadius="10">
<StackPanel Margin="24,20">
<TextBlock x:Name="ExportOptionsText" Text="Export options" FontSize="16" FontWeight="SemiBold" Foreground="#1A1A1A" Margin="0,0,0,20"/>
<!-- Selected Count -->
<Border Background="#F0F7FF" CornerRadius="8" Padding="16,14" Margin="0,0,0,20">
<StackPanel>
<TextBlock x:Name="SelectedText" Text="Selected" FontSize="11" Foreground="#666" FontWeight="SemiBold"/>
<StackPanel Orientation="Horizontal" Margin="0,4,0,0">
<TextBlock x:Name="SelectedCount" Text="0" FontSize="28" FontWeight="Bold" Foreground="#0078D4"/>
<TextBlock x:Name="SelectedLabel" Text=" lists" FontSize="14" Foreground="#666" VerticalAlignment="Bottom" Margin="0,0,0,4"/>
</StackPanel>
</StackPanel>
</Border>
<!-- Format Selection -->
<TextBlock x:Name="FormatText" Text="Format" FontSize="13" Foreground="#666" Margin="0,0,0,8"/>
<ComboBox x:Name="FormatComboBox" Height="44" FontSize="14" Padding="12,0" SelectedIndex="0"
SelectionChanged="FormatComboBox_SelectionChanged">
<ComboBoxItem x:Name="FormatExcelItem" Content="Excel (.xlsx)" Tag="Excel"/>
<ComboBoxItem x:Name="FormatTodoistCsvItem" Content="Todoist CSV (.csv)" Tag="TodoistCsv"/>
<ComboBoxItem x:Name="FormatJsonItem" Content="JSON (.json)" Tag="Json"/>
<ComboBoxItem x:Name="FormatTextItem" Content="Text (.txt)" Tag="Text"/>
<ComboBoxItem x:Name="FormatDetailedTextItem" Content="Detailed Text (.txt)" Tag="DetailedText"/>
<ComboBoxItem x:Name="FormatDetailedCsvItem" Content="Detailed CSV (.csv)" Tag="DetailedCsv"/>
</ComboBox>
<!-- Format Description -->
<TextBlock x:Name="FormatDescription"
Text="Compatible with Todoist import function"
FontSize="11" Foreground="#888" Margin="0,6,0,0" TextWrapping="Wrap"/>
<!-- Options -->
<CheckBox x:Name="IncludeCompletedCheckBox"
Content="Include completed tasks"
IsChecked="True"
Margin="0,20,0,0"
FontSize="13"
Foreground="#444"
Cursor="Hand"/>
<!-- Export Button -->
<Button x:Name="ExportButton"
Content="Export"
Style="{StaticResource PrimaryButton}"
FontSize="15" Margin="0,28,0,0"
HorizontalAlignment="Stretch"
Click="ExportButton_Click"/>
<TextBlock x:Name="ExportHint"
Text="Select at least one list"
FontSize="11" Foreground="#AAA"
HorizontalAlignment="Center" Margin="0,12,0,0"/>
</StackPanel>
</Border>
</Grid>
</Grid>
<!-- Status Bar -->
<Border Grid.Row="2" Background="White" Padding="28,12" BorderBrush="#E0E0E0" BorderThickness="0,1,0,0">
<Grid>
<TextBlock x:Name="StatusText" Text="Ready" FontSize="12" Foreground="#888" VerticalAlignment="Center"/>
<ProgressBar x:Name="LoadingBar" IsIndeterminate="True" Width="120" Height="3"
HorizontalAlignment="Right" Visibility="Collapsed" Foreground="#0078D4"/>
</Grid>
</Border>
</Grid>
</Window>