-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml
674 lines (652 loc) · 40.5 KB
/
App.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
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
<Application x:Class="BauphysikToolWPF.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:BauphysikToolWPF.UI.CustomControls"
StartupUri="MainWindow.xaml">
<!--Sets Resources available for entire Application-->
<Application.Resources>
<!--Application Color Palette-->
<SolidColorBrush x:Key="PrimaryDarkBrush" Color="#253858"/>
<SolidColorBrush x:Key="PrimaryDarkHighlightBrush" Color="#1d2c46"/>
<SolidColorBrush x:Key="PrimaryDarkMediumBrush" Color="#6e7a8f"/>
<SolidColorBrush x:Key="PrimaryMediumBrush" Color="LightGray"/>
<SolidColorBrush x:Key="PrimaryLightBrush" Color="#EDEDED"/>
<SolidColorBrush x:Key="PrimaryHighlightBrush" Color="#1473e6"/>
<SolidColorBrush x:Key="PrimaryBorderBrush" Color="#FFABADB3"/>
<SolidColorBrush x:Key="PrimaryHoverBrush" Color="#BEE6FD"/>
<!--Button Icons source paths-->
<BitmapImage x:Key="ButtonIcon_Add_B" UriSource="/Resources/Icons/plus.png"/>
<BitmapImage x:Key="ButtonIcon_Add_W" UriSource="/Resources/Icons/plus_w.png"/>
<BitmapImage x:Key="ButtonIcon_AddLayer_B" UriSource="/Resources/Icons/add_layer.png"/>
<BitmapImage x:Key="ButtonIcon_AddLayer_W" UriSource="/Resources/Icons/add_layer_w.png"/>
<BitmapImage x:Key="ButtonIcon_AddElement_B" UriSource="/Resources/Icons/add_element.png"/>
<BitmapImage x:Key="ButtonIcon_AddElement_W" UriSource="/Resources/Icons/add_element_w.png"/>
<BitmapImage x:Key="ButtonIcon_Delete_B" UriSource="/Resources/Icons/delete-2.png"/>
<BitmapImage x:Key="ButtonIcon_DeleteLayer_B" UriSource="/Resources/Icons/delete_layer.png"/>
<BitmapImage x:Key="ButtonIcon_DeleteLayer_W" UriSource="/Resources/Icons/delete_layer_w.png"/>
<BitmapImage x:Key="ButtonIcon_DeleteElement_B" UriSource="/Resources/Icons/delete_element.png"/>
<BitmapImage x:Key="ButtonIcon_DeleteElement_W" UriSource="/Resources/Icons/delete_element_w.png"/>
<BitmapImage x:Key="ButtonIcon_Edit_B" UriSource="/Resources/Icons/edit-2.png"/>
<BitmapImage x:Key="ButtonIcon_Cancel_B" UriSource="/Resources/Icons/kreuzkreis.png"/>
<BitmapImage x:Key="ButtonIcon_Cancel_W" UriSource="/Resources/Icons/kreuzkreis_w.png"/>
<BitmapImage x:Key="ButtonIcon_Exit_B" UriSource="/Resources/Icons/kreuz.png"/>
<BitmapImage x:Key="ButtonIcon_Exit_W" UriSource="/Resources/Icons/kreuz_w.png"/>
<BitmapImage x:Key="ButtonIcon_OK_B" UriSource="/Resources/Icons/haken.png"/>
<BitmapImage x:Key="ButtonIcon_OK_W" UriSource="/Resources/Icons/haken_w.png"/>
<BitmapImage x:Key="ButtonIcon_OK_Green" UriSource="/Resources/Icons/haken_g.png"/>
<BitmapImage x:Key="ButtonIcon_Elements_B" UriSource="/Resources/Icons/elements.png"/>
<BitmapImage x:Key="ButtonIcon_Elements_W" UriSource="/Resources/Icons/elements_w.png"/>
<BitmapImage x:Key="ButtonIcon_Layer_B" UriSource="/Resources/Icons/layer.png"/>
<BitmapImage x:Key="ButtonIcon_Layer_W" UriSource="/Resources/Icons/layer_w.png"/>
<BitmapImage x:Key="ButtonIcon_EnvVar_B" UriSource="/Resources/Icons/einstellungen-schieberegler.png"/>
<BitmapImage x:Key="ButtonIcon_EnvVar_W" UriSource="/Resources/Icons/einstellungen-schieberegler_w.png"/>
<BitmapImage x:Key="ButtonIcon_Show_B" UriSource="/Resources/Icons/auge.png"/>
<BitmapImage x:Key="ButtonIcon_Show_W" UriSource="/Resources/Icons/auge_w.png"/>
<BitmapImage x:Key="ButtonIcon_Hide_B" UriSource="/Resources/Icons/auge_zu.png"/>
<BitmapImage x:Key="ButtonIcon_Hide_W" UriSource="/Resources/Icons/auge_zu_w.png"/>
<BitmapImage x:Key="ButtonIcon_Lock_B" UriSource="/Resources/Icons/schloss_zu.png"/>
<BitmapImage x:Key="ButtonIcon_Lock_W" UriSource="/Resources/Icons/schloss_zu_w.png"/>
<BitmapImage x:Key="ButtonIcon_Moisture_B" UriSource="/Resources/Icons/moisture.png"/>
<BitmapImage x:Key="ButtonIcon_Moisture_W" UriSource="/Resources/Icons/moisture_w.png"/>
<BitmapImage x:Key="ButtonIcon_Temperature_B" UriSource="/Resources/Icons/chart.png"/>
<BitmapImage x:Key="ButtonIcon_Temperature_W" UriSource="/Resources/Icons/chart_w.png"/>
<BitmapImage x:Key="ButtonIcon_House_B" UriSource="/Resources/Icons/house.png"/>
<BitmapImage x:Key="ButtonIcon_House_W" UriSource="/Resources/Icons/house_w.png"/>
<BitmapImage x:Key="ButtonIcon_ExistingHouse_B" UriSource="/Resources/Icons/existing_home.png"/>
<BitmapImage x:Key="ButtonIcon_ExistingHouse_W" UriSource="/Resources/Icons/existing_home_w.png"/>
<BitmapImage x:Key="ButtonIcon_Office_B" UriSource="/Resources/Icons/office.png"/>
<BitmapImage x:Key="ButtonIcon_Office_W" UriSource="/Resources/Icons/office_w.png"/>
<BitmapImage x:Key="ButtonIcon_New_B" UriSource="/Resources/Icons/new.png"/>
<BitmapImage x:Key="ButtonIcon_New_W" UriSource="/Resources/Icons/new_w.png"/>
<BitmapImage x:Key="ButtonIcon_Accepted_B" UriSource="/Resources/Icons/akzeptiert.png"/>
<BitmapImage x:Key="ButtonIcon_Accepted_W" UriSource="/Resources/Icons/akzeptiert_w.png"/>
<BitmapImage x:Key="ButtonIcon_Prev_B" UriSource="/Resources/Icons/prev.png"/>
<BitmapImage x:Key="ButtonIcon_Prev_W" UriSource="/Resources/Icons/prev_w.png"/>
<BitmapImage x:Key="ButtonIcon_Next_B" UriSource="/Resources/Icons/next.png"/>
<BitmapImage x:Key="ButtonIcon_Next_W" UriSource="/Resources/Icons/next_w.png"/>
<BitmapImage x:Key="ButtonIcon_Project_B" UriSource="/Resources/Icons/project-2.png"/>
<BitmapImage x:Key="ButtonIcon_Project_W" UriSource="/Resources/Icons/project-2_w.png"/>
<BitmapImage x:Key="ButtonIcon_Projects_B" UriSource="/Resources/Icons/projects.png"/>
<BitmapImage x:Key="ButtonIcon_Projects_W" UriSource="/Resources/Icons/projects_w.png"/>
<BitmapImage x:Key="ButtonIcon_Save_B" UriSource="/Resources/Icons/save.png"/>
<BitmapImage x:Key="ButtonIcon_Save_W" UriSource="/Resources/Icons/save_w.png"/>
<BitmapImage x:Key="ButtonIcon_OpenProject_B" UriSource="/Resources/Icons/open_project.png"/>
<BitmapImage x:Key="ButtonIcon_OpenProject_W" UriSource="/Resources/Icons/open_project_w.png"/>
<BitmapImage x:Key="ButtonIcon_Settings_B" UriSource="/Resources/Icons/settings.png"/>
<BitmapImage x:Key="ButtonIcon_Settings_W" UriSource="/Resources/Icons/settings_w.png"/>
<BitmapImage x:Key="ButtonIcon_Download_B" UriSource="/Resources/Icons/download.png"/>
<BitmapImage x:Key="ButtonIcon_Download_W" UriSource="/Resources/Icons/download_w.png"/>
<BitmapImage x:Key="ButtonIcon_Copy_B" UriSource="/Resources/Icons/copy.png"/>
<BitmapImage x:Key="ButtonIcon_Copy_W" UriSource="/Resources/Icons/copy_w.png"/>
<BitmapImage x:Key="ButtonIcon_Export_B" UriSource="/Resources/Icons/export.png"/>
<BitmapImage x:Key="ButtonIcon_Export_W" UriSource="/Resources/Icons/export_w.png"/>
<BitmapImage x:Key="ButtonIcon_Up_B" UriSource="/Resources/Icons/up.png"/>
<BitmapImage x:Key="ButtonIcon_Down_B" UriSource="/Resources/Icons/down.png"/>
<BitmapImage x:Key="ButtonIcon_ImagePlaceholder_B" UriSource="/Resources/Icons/placeholder_256px.png"/>
<!--Custom TextBox for Subscript Text with Equation-->
<Style TargetType="{x:Type controls:EquationLabel}">
<Setter Property="FontSize" Value="14"/>
<Setter Property="SubscriptFontSize" Value="12"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:EquationLabel}">
<StackPanel Orientation="Horizontal">
<TextBlock FontSize="{TemplateBinding FontSize}" Text="{TemplateBinding BaseText}" VerticalAlignment="Center"/>
<TextBlock FontSize="{TemplateBinding FontSize}" Margin="-3,1,0,0" VerticalAlignment="Center">
<Run Text=""/>
<Run BaselineAlignment="Subscript" Text="{TemplateBinding SubscriptText}" FontSize="{TemplateBinding SubscriptFontSize}"/>
</TextBlock>
<TextBlock x:Name="equals" FontSize="{TemplateBinding FontSize}" Text=" = " VerticalAlignment="Center"/>
<TextBlock FontSize="{TemplateBinding FontSize}" Text="{TemplateBinding Value}" VerticalAlignment="Center"/>
<TextBlock x:Name="placeholder" FontSize="{TemplateBinding FontSize}" Text=" " VerticalAlignment="Center"/>
<TextBlock FontSize="{TemplateBinding FontSize}" Text="{TemplateBinding Unit}" VerticalAlignment="Center"/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Custom Label for Subscript Text-->
<Style TargetType="{x:Type controls:SubscriptLabel}">
<Setter Property="FontSize" Value="14"/>
<Setter Property="SubscriptFontSize" Value="12"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:SubscriptLabel}">
<StackPanel Orientation="Horizontal">
<TextBlock FontSize="{TemplateBinding FontSize}" Text="{TemplateBinding PrependText}" VerticalAlignment="Center"/>
<TextBlock FontSize="{TemplateBinding FontSize}" Text="{TemplateBinding BaseText}" VerticalAlignment="Center"/>
<TextBlock FontSize="{TemplateBinding FontSize}" Margin="-3,1,0,0" VerticalAlignment="Center">
<Run Text=""/>
<Run BaselineAlignment="Subscript" Text="{TemplateBinding SubscriptText}" FontSize="{TemplateBinding SubscriptFontSize}"/>
</TextBlock>
<TextBlock FontSize="{TemplateBinding FontSize}" Text="{TemplateBinding AppendText}" VerticalAlignment="Center"/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Custom TextBox for fractions-->
<Style TargetType="{x:Type controls:FractionLabel}">
<Setter Property="FontSize" Value="14"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:FractionLabel}">
<StackPanel Orientation="Vertical">
<TextBlock Height="18" FontSize="{TemplateBinding FontSize}" Text="{TemplateBinding CounterText}" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,1"/>
<Line X2="30" StrokeThickness="1" Stroke="Black" VerticalAlignment="Center"/>
<TextBlock Height="18" FontSize="{TemplateBinding FontSize}" Text="{TemplateBinding DenominatorText}" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,-2,0,0"/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Custom Label Style -->
<!-- Applies on every Label in this App -->
<Style x:Key="{x:Type Label}" TargetType="{x:Type Label}">
<Setter Property="FontSize" Value="14"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<!-- TEST Custom ComboBox Style: ... -->
<!-- Applies on every ComboBox in this App -->
<Style x:Key="{x:Type ComboBox}" TargetType="{x:Type ComboBox}">
<Setter Property="SnapsToDevicePixels" Value="true" />
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="Background" Value="{StaticResource PrimaryMediumBrush}"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<!-- CanContentScroll = false for smooth scrolling -->
<Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
<Setter Property="MinWidth" Value="144"/>
<Setter Property="Height" Value="32"/>
<Setter Property="MaxDropDownHeight" Value="320"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBox}">
<Grid>
<!--The DropDownButton when closed-->
<ToggleButton x:Name="ToggleButton" Grid.Column="2" Focusable="false" ClickMode="Press" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
<ToggleButton.Template>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<Border x:Name="Border" Grid.ColumnSpan="2" CornerRadius="4" Background="{TemplateBinding Background}" />
<Path x:Name="Arrow" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 4 4 L 8 0 Z" Fill="{StaticResource PrimaryDarkBrush}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource PrimaryHoverBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
<!--Content inside of closed DropDownButton -->
<ContentPresenter x:Name="ContentSite" IsHitTestVisible="False"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
Margin="6,6,26,6"
VerticalAlignment="Stretch"
HorizontalAlignment="Left"/>
<!--Invisible Element of closed DropDownButton
<TextBox x:Name="PART_EditableTextBox" Style="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="6,6,26,6" Focusable="True" Background="Transparent" Visibility="Hidden" IsReadOnly="{TemplateBinding IsReadOnly}">
<TextBox.Template>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border x:Name="PART_ContentHost" Focusable="False"/>
</ControlTemplate>
</TextBox.Template>
</TextBox>-->
<!-- DropDown Menu / Popup -->
<Popup x:Name="Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Slide">
<Grid x:Name="DropDown" SnapsToDevicePixels="True" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
<Border x:Name="DropDownBorder" BorderThickness="1" Background="{StaticResource PrimaryLightBrush}" BorderBrush="{StaticResource PrimaryBorderBrush}"/>
<!-- Margin includes 4px Gap between Popup and DropDownButton -->
<ScrollViewer Margin="4,8,4,4" SnapsToDevicePixels="True">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Grid>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="HasItems" Value="false">
<Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
</Trigger>
<Trigger Property="IsGrouping" Value="true">
<Setter Property="ScrollViewer.CanContentScroll" Value="false" />
</Trigger>
<Trigger SourceName="Popup" Property="AllowsTransparency" Value="true">
<Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4" />
<!-- 4px Gap between Popup and DropDownButton -->
<Setter TargetName="DropDownBorder" Property="Margin" Value="0,4,0,0" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Custom ComboBoxItem Style -->
<!-- Applies on every ComboBoxItem in this App -->
<Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
<Setter Property="SnapsToDevicePixels" Value="true" />
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="Padding" Value="4"/>
<Setter Property="Background" Value="{StaticResource PrimaryLightBrush}"/>
<Setter Property="Height" Value="32"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBoxItem}">
<Border CornerRadius="4"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="true">
<ContentPresenter VerticalAlignment="Center" Margin="4,0,0,0"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource PrimaryHoverBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Custom TextBox Style: Underlined, Transparent BG, small rounded corners -->
<!-- Applies on every TextBox in this App -->
<Style x:Key="{x:Type TextBox}" TargetType="{x:Type TextBox}">
<!--These setters are for the default appearance-->
<Setter Property="MinWidth" Value="48"/>
<Setter Property="Height" Value="32"/>
<Setter Property="MaxLength" Value="80"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="BorderBrush" Value="{StaticResource PrimaryDarkBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBoxBase}">
<Border BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" CornerRadius="2" BorderThickness="0,0,0,2">
<ScrollViewer Margin="0" x:Name="PART_ContentHost" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource PrimaryHoverBrush}"/>
</Trigger>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="BorderBrush" Value="{StaticResource PrimaryHighlightBrush}"/>
</Trigger>
</Style.Triggers>
</Style>
<!--Custom ContextMenu Style: Used in ContextMenu as 'Style'-->
<!-- Applies on every ContextMenu in this App -->
<Style x:Key="{x:Type ContextMenu}" TargetType="{x:Type ContextMenu}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Background" Value="{StaticResource PrimaryLightBrush}"/>
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Grid.IsSharedSizeScope" Value="True" />
<Setter Property="MinWidth" Value="120"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border BorderBrush="{StaticResource PrimaryBorderBrush}" Background="{TemplateBinding Background}" Padding="4" CornerRadius="8" BorderThickness="1">
<!--Force MenuItems to set the size of parent. If omitted, ContextMenu has size 0x0-->
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ContextMenu entry (MenuItem) appearance and behaviour: Used in ContextMenu as 'ItemContainerStyle' -->
<!-- Applies on every (Context) MenuItem in this App -->
<Style x:Key="{x:Type MenuItem}" TargetType="{x:Type MenuItem}">
<Setter Property="Padding" Value="4"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Height" Value="32"/>
<Setter Property="MinWidth" Value="160"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type MenuItem}">
<Border x:Name="menuItem_Border"
CornerRadius="4"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="true">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ContentPresenter Grid.Column="0" Content="{TemplateBinding Icon}" Margin="4,4,16,4" MaxHeight="{TemplateBinding Height}" MaxWidth="{TemplateBinding Height}"/>
<TextBlock Grid.Column="1" Text="{TemplateBinding Header}" VerticalAlignment="Center"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX=".96" ScaleY=".96" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource PrimaryHoverBrush}"/>
</Trigger>
</Style.Triggers>
</Style>
<!--Custom Button02_A: full rounded corners, highlighted blue, click effects-->
<Style x:Key="ButtonStyle02_A" TargetType="{x:Type Button}">
<Setter Property="Background" Value="{StaticResource PrimaryHighlightBrush}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Height" Value="32"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX=".96" ScaleY=".96" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
<Style.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="16"/>
</Style>
</Style.Resources>
</Style>
<!--Custom Button02_B: full rounded corners, click effects-->
<Style x:Key="ButtonStyle02_B" TargetType="{x:Type Button}">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="{StaticResource PrimaryMediumBrush}"/>
<Setter Property="Height" Value="32"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX=".96" ScaleY=".96" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
<Style.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="16"/>
</Style>
</Style.Resources>
</Style>
<!--Custom Button03_A: with icon, highlighted, rounded corners, click effects
Icon gets passed by the 'Tag' Property:
Tag: "Gets or sets an arbitrary object value that can be used to store custom information about this element."
-->
<Style x:Key="ButtonStyle03_A" TargetType="{x:Type Button}">
<!--Set default properties of the button-->
<Setter Property="Content" Value="Placeholder"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="{StaticResource PrimaryHighlightBrush}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="MinHeight" Value="32"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<!--Set appearance of the element-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<!--Element appearance with behaviour of a 'Button'-->
<Border x:Name="btn_border" CornerRadius="8" Background="{TemplateBinding Background}">
<StackPanel Orientation="Horizontal">
<!--Bind Image via DataContext Property in the Button Element-->
<Image x:Name="ButtonIcon" Source="{TemplateBinding Tag}" Stretch="Fill" Width="20" Height="20" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10"/>
<TextBlock x:Name="ButtonLabel" Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" Margin="4,4,16,4" FontWeight="Bold" FontSize="14"/>
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Setter.Value>
</Setter>
<!--Set Triggers and Effects-->
<Style.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX=".96" ScaleY=".96" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource PrimaryHoverBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
</Style.Triggers>
</Style>
<!--Custom Button03_B: with icon, rounded corners, click effects -->
<Style x:Key="ButtonStyle03_B" TargetType="{x:Type Button}">
<!--Set default properties of the button-->
<Setter Property="Content" Value="Placeholder"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="{StaticResource PrimaryMediumBrush}"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="MinHeight" Value="32"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<!--Set appearance of the element-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<!--Element appearance with behaviour of a 'Button'-->
<Border x:Name="btn_border" CornerRadius="8" Background="{TemplateBinding Background}">
<StackPanel Orientation="Horizontal">
<!--Bind Image via DataContext Property in the Button Element-->
<Image Source="{TemplateBinding Tag}" Stretch="Fill" Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10"/>
<TextBlock Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" Margin="4,4,16,4" FontWeight="Bold" FontSize="14"/>
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Setter.Value>
</Setter>
<!--Set Triggers and Effects-->
<Style.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX=".96" ScaleY=".96" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource PrimaryHoverBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
</Style.Triggers>
</Style>
<!--Custom Button03_Mini: only icon, transparent, rounded corners, click effects -->
<Style x:Key="ButtonStyle03_Mini" TargetType="{x:Type Button}">
<!--Set default properties of the button-->
<Setter Property="Content" Value="Placeholder"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="MinWidth" Value="24"/>
<Setter Property="MinHeight" Value="24"/>
<Setter Property="MaxWidth" Value="48"/>
<Setter Property="MaxHeight" Value="48"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<!--Set appearance of the element-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<!--Element appearance with behaviour of a 'Button'-->
<Border x:Name="btn_border" CornerRadius="8" Background="{TemplateBinding Background}">
<StackPanel Orientation="Horizontal">
<!--Bind Image via DataContext Property in the Button Element-->
<Image Source="{TemplateBinding Tag}" Stretch="Fill" MinWidth="16" MinHeight="16" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8"/>
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Setter.Value>
</Setter>
<!--Set Triggers and Effects-->
<Style.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX=".96" ScaleY=".96" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource PrimaryHoverBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
</Style.Triggers>
</Style>
<!--Custom Button03_B_Icon: like Button03_B but only icon -->
<Style x:Key="ButtonStyle03_B_Icon" TargetType="{x:Type Button}">
<!--Set default properties of the button-->
<Setter Property="Background" Value="{StaticResource PrimaryMediumBrush}"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="MinWidth" Value="32"/>
<Setter Property="MinHeight" Value="32"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<!--Set appearance of the element-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<!--Element appearance with behaviour of a 'Button'-->
<Border x:Name="btn_border" CornerRadius="8" Background="{TemplateBinding Background}">
<StackPanel Orientation="Horizontal">
<!--Bind Image via DataContext Property in the Button Element-->
<Image Source="{TemplateBinding Tag}" Stretch="Fill" Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10"/>
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Setter.Value>
</Setter>
<!--Set Triggers and Effects-->
<Style.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX=".96" ScaleY=".96" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource PrimaryHoverBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
</Style.Triggers>
</Style>
<!--Custom Button04: rounded corners, click effects, materialUI -->
<Style x:Key="ButtonStyle04" TargetType="{x:Type Button}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="MinHeight" Value="32"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="border" CornerRadius="6" Background="{TemplateBinding Background}" BorderThickness="1">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect BlurRadius="10" ShadowDepth="1" Color="LightSlateGray" Opacity=".6"/>
</Setter.Value>
</Setter>
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FF6DD46D"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX=".96" ScaleY=".96" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="Gray"/>
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect BlurRadius="10" ShadowDepth="1" Color="LightSlateGray" Opacity=".2"/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</Application.Resources>
</Application>