-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
349 lines (328 loc) · 16.6 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
<mah:MetroWindow x:Class="Automatisiertes_Kopieren.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
Title="Automatisiertes Kopieren"
MinHeight="300" MinWidth="550"
Width="600" Height="600"
Closed="MainWindow_Closed">
<DockPanel>
<!-- Menu at the top -->
<Menu DockPanel.Dock="Top" FontSize="14">
<Menu.Resources>
<!-- Style for the top-level menu items -->
<Style x:Key="TopLevelMenuItemStyle" TargetType="MenuItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MenuItem">
<Border x:Name="Bd"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<ContentPresenter ContentSource="Header"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True" />
<Popup x:Name="SubMenuPopup"
Placement="Bottom"
IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
AllowsTransparency="True">
<Border x:Name="SubMenuBorder"
Background="White"
BorderBrush="#CCCCCC"
BorderThickness="1">
<StackPanel IsItemsHost="True" />
</Border>
</Popup>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted"
Value="True">
<Setter TargetName="Bd"
Property="Background"
Value="#E5E5E5"/>
</Trigger>
<Trigger Property="IsSubmenuOpen"
Value="True">
<Setter TargetName="Bd"
Property="Background"
Value="#E5E5E5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Style for the child menu items -->
<Style TargetType="MenuItem">
<!-- ... Your existing setters ... -->
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Left" />
<!-- Modify the ControlTemplate for the MenuItem -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MenuItem">
<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<ContentPresenter ContentSource="Header" Margin="10 0" RecognizesAccessKey="True" />
<Popup x:Name="SubMenuPopup" Placement="Bottom" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" AllowsTransparency="True">
<Border x:Name="SubMenuBorder" Background="White" BorderBrush="#CCCCCC" BorderThickness="1">
<StackPanel IsItemsHost="True" />
</Border>
</Popup>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#E5E5E5"/>
</Trigger>
<Trigger Property="IsSubmenuOpen" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#E5E5E5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Menu.Resources>
<Menu.Background>
<SolidColorBrush Color="Transparent"/>
</Menu.Background>
<MenuItem Header="Datei"
Style="{StaticResource TopLevelMenuItemStyle}">
<MenuItem Header="Heimordner Auswählen"
Click="OnSelectHomeFolderButtonClicked">
</MenuItem>
</MenuItem>
<MenuItem Header="Hilfe" Style="{StaticResource TopLevelMenuItemStyle}">
<MenuItem Header="Über Automatisiertes-Kopieren" Click="OnAboutClicked"/>
</MenuItem>
</Menu>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<!-- Group Dropdown -->
<RowDefinition Height="Auto"/>
<!-- Kid Name -->
<RowDefinition Height="Auto"/>
<!-- Report Month -->
<RowDefinition Height="Auto"/>
<!-- Report Year -->
<RowDefinition Height="Auto"/>
<!-- Protokollbogen Setup -->
<RowDefinition Height="Auto"/>
<!-- Vorschulentwicklungsbericht -->
<RowDefinition Height="Auto"/>
<!-- Allgemeiner Entwicklungsbericht -->
<RowDefinition Height="Auto"/>
<!-- Krippe Uebergangsbericht -->
<RowDefinition Height="Auto"/>
<!-- Select Home Folder Button and Generate Button -->
<RowDefinition Height="*"/>
<!-- Output TextBox -->
</Grid.RowDefinitions>
<!-- Group Dropdown -->
<Label Content="Gruppe:"
Grid.Row="0"
Margin="10,10,10,10" />
<ComboBox x:Name="GroupDropdown"
Grid.Row="0" Grid.Column="1"
Style="{DynamicResource MahApps.Styles.ComboBox}"
SelectionChanged="OnGroupSelected"
Margin="10,10,10,10">
<ComboBoxItem Content="Bären" IsSelected="True"/>
<ComboBoxItem Content="Löwen"/>
<ComboBoxItem Content="Schnecken"/>
</ComboBox>
<!-- Kid Name -->
<Label Content="Kind Name:"
Grid.Row="1" Grid.Column="0"
Margin="10,0,10,10" />
<ComboBox x:Name="KidNameComboBox"
PreviewTextInput="KidNameComboBox_PreviewTextInput"
KeyDown="KidNameComboBox_KeyDown"
Grid.Row="1" Grid.Column="1"
Margin="10,0,10,10"
IsTextSearchEnabled="False"
IsEditable="True"
LostFocus="KidNameComboBox_LostFocus"
Loaded="KidNameComboBox_Loaded"/>
<!-- Report Month -->
<Label Content="E-Bericht Monat:"
Grid.Row="2" Grid.Column="0"
Margin="10,0,10,10"/>
<ComboBox x:Name="ReportMonthDropdown"
Grid.Row="2" Grid.Column="1"
Margin="10,0,10,10">
<ComboBoxItem Content="Januar" IsSelected="True"/>
<ComboBoxItem Content="Februar"/>
<ComboBoxItem Content="März"/>
<ComboBoxItem Content="April"/>
<ComboBoxItem Content="Mai"/>
<ComboBoxItem Content="Juni"/>
<ComboBoxItem Content="Juli"/>
<ComboBoxItem Content="August"/>
<ComboBoxItem Content="September"/>
<ComboBoxItem Content="Oktober"/>
<ComboBoxItem Content="November"/>
<ComboBoxItem Content="Dezember"/>
</ComboBox>
<!-- Report Year -->
<Label Content="E-Bericht Jahr:"
Grid.Row="3" Grid.Column="0"
HorizontalAlignment="Left" VerticalAlignment="Center"
Margin="10,0,10,10"/>
<TextBox x:Name="ReportYearTextbox"
Grid.Row="3" Grid.Column="1"
HorizontalAlignment="Stretch" VerticalAlignment="Center"
Margin="10,0,10,10"/>
<!-- Protokollbogen Setup -->
<Label Content="Protokollbogen:"
Grid.Row="4" Grid.Column="0"
HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="10,0,0,0"/>
<Grid Grid.Row="4" Grid.Column="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
Margin="10,0,10,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<!-- For the "Manuell:" label -->
<ColumnDefinition Width="*"/>
<!-- For the ComboBox -->
<ColumnDefinition Width="Auto"/>
<!-- For the "Automatisch" label -->
<ColumnDefinition Width="Auto"/>
<!-- For the CheckBox -->
</Grid.ColumnDefinitions>
<Label Content="Manuell:"
Grid.Column="0"
VerticalAlignment="Center" />
<!-- New ComboBox for manual month selection -->
<ComboBox Grid.Column="1"
HorizontalAlignment="Stretch" VerticalAlignment="Center"
Margin="5,0" >
<!-- Adding the valid months directly in the XAML -->
<ComboBoxItem Content="12 Monate Protokollbogen" />
<ComboBoxItem Content="18 Monate Protokollbogen" />
<ComboBoxItem Content="24 Monate Protokollbogen" />
<ComboBoxItem Content="30 Monate Protokollbogen" />
<ComboBoxItem Content="36 Monate Protokollbogen" />
<ComboBoxItem Content="42 Monate Protokollbogen" />
<ComboBoxItem Content="48 Monate Protokollbogen" />
<ComboBoxItem Content="54 Monate Protokollbogen" />
<ComboBoxItem Content="60 Monate Protokollbogen" />
<ComboBoxItem Content="66 Monate Protokollbogen" />
<ComboBoxItem Content="72 Monate Protokollbogen" />
<ComboBox.Style>
<Style TargetType="ComboBox">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ProtokollbogenAutoCheckbox, Path=IsChecked}"
Value="True">
<Setter Property="IsEnabled" Value="False"/>
<Setter Property="Background" Value="LightGray"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=ProtokollbogenAutoCheckbox, Path=IsChecked}"
Value="False">
<Setter Property="IsEnabled" Value="True"/>
<Setter Property="Background" Value="White"/>
</DataTrigger>
</Style.Triggers>
</Style>
</ComboBox.Style>
</ComboBox>
<Label Content="Automatisch"
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,0,10,0"/>
<CheckBox x:Name="ProtokollbogenAutoCheckbox"
Grid.Column="3"
VerticalAlignment="Center"
Checked="OnProtokollbogenAutoCheckboxChanged"
Unchecked="OnProtokollbogenAutoCheckboxChanged"
Margin="0"/>
</Grid>
<!-- Vorschulentwicklungsbericht -->
<Grid Grid.Row="5" Grid.Column="0"
HorizontalAlignment="Stretch" VerticalAlignment="Center"
Grid.ColumnSpan="2"
Margin="10,0,10,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label Content="Vorschulentwicklungsbericht:"
Grid.Column="0"
VerticalAlignment="Center" />
<CheckBox x:Name="VorschulentwicklungsberichtCheckbox"
Grid.Column="1"
VerticalAlignment="Center"
Margin="0,0,0,0"/>
</Grid>
<!-- Allgemeiner Entwicklungsbericht -->
<Grid Grid.Row="6" Grid.Column="0"
HorizontalAlignment="Stretch" VerticalAlignment="Center"
Grid.ColumnSpan="2"
Margin="10,0,10,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label Content="Allgemeiner Entwicklungsbericht:"
Grid.Column="0"
VerticalAlignment="Center" />
<CheckBox x:Name="AllgemeinerEntwicklungsberichtCheckbox"
Grid.Column="1"
VerticalAlignment="Center"
Margin="0,0,0,0"/>
</Grid>
<!-- Krippe Übergangsbericht -->
<Grid Grid.Row="7" Grid.Column="0"
HorizontalAlignment="Stretch" VerticalAlignment="Center"
Grid.ColumnSpan="2"
Margin="10,0,10,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label Content="Krippe Übergangsbericht:"
Grid.Column="0"
VerticalAlignment="Center" />
<CheckBox x:Name="KrippeUebergangsberichtCheckbox"
Grid.Column="1"
VerticalAlignment="Center"
Margin="0,0,0,0"/>
</Grid>
<!-- Kopieren Button -->
<Button Content="Kopieren"
Grid.Row="8" Grid.Column="1"
HorizontalAlignment="Right" VerticalAlignment="Center"
Click="OnGenerateButtonClickedAsync"
Margin="0,0,10,0"/>
<!-- Select Heutiges Datum Button -->
<StackPanel Grid.Row="8" Grid.Column="0"
HorizontalAlignment="Left" VerticalAlignment="Center"
Grid.ColumnSpan="2" Orientation="Horizontal"
Margin="15,0,10,5">
<TextBlock Text="Heutiges Datum für Entwicklungsbericht"
VerticalAlignment="Center"
Margin="0,0,10,0"/>
<CheckBox x:Name="UpdateMonatsrechnerCheckBox"
Click="OnSelectHeutigesDatumEntwicklungsBericht"
VerticalAlignment="Center"/>
</StackPanel>
<!-- Ausgabe TextBox -->
<TextBox x:Name="OutputTextBox"
Grid.Row="9" Grid.Column="0"
IsReadOnly="True"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
TextWrapping="Wrap" Grid.ColumnSpan="2"
Margin="10"/>
</Grid>
</DockPanel>
</mah:MetroWindow>