-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
536 lines (503 loc) · 31.2 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
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
<Window x:Class="BauphysikToolWPF.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"
xmlns:local="clr-namespace:BauphysikToolWPF"
xmlns:ui="clr-namespace:BauphysikToolWPF.UI"
xmlns:vm="clr-namespace:BauphysikToolWPF.UI.ViewModels"
xmlns:controls="clr-namespace:BauphysikToolWPF.UI.CustomControls"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
d:DataContext="{d:DesignInstance vm:MainWindow_VM}"
mc:Ignorable="d"
Title="{Binding Title}"
Height="700"
Width="1280"
Background="{StaticResource PrimaryLightBrush}"
WindowStartupLocation="CenterScreen"
Closing="MainWindow_OnClosing"
Loaded="MainWindow_OnLoaded"
StateChanged="MainWindow_StateChanged"
TextOptions.TextFormattingMode="Display"
WindowStyle="None">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
</WindowChrome.WindowChrome>
<!--
Additionally added: d:DataContext="{d:DesignInstance vm:MainWindow_VM}"
to the xaml constructor to be able to acces Named Elements in code behind
-->
<Window.DataContext>
<vm:MainWindow_VM/>
</Window.DataContext>
<!-- https://www.codeproject.com/Articles/5275552/WPF-Compact-Navigation-Menu -->
<Window.Resources>
<!-- Checks if an ListBoxItem from ItemsSource is a Header or not-->
<controls:IsHeaderConverter x:Key="IsHeaderConverter"/>
<!--The actual content pages: Used in MainWindow.xaml ContentControl to set the current page-->
<DataTemplate x:Key="FO0_ProjectPage">
<ui:Page_Project/>
</DataTemplate>
<DataTemplate x:Key="FO1_ElementsPage">
<ui:Page_Elements/>
</DataTemplate>
<DataTemplate x:Key="FO1_LayerSetup">
<ui:Page_LayerSetup/>
</DataTemplate>
<DataTemplate x:Key="FO1_Summary">
<ui:Page_Summary/>
</DataTemplate>
<DataTemplate x:Key="FO2_Temperature">
<ui:Page_TemperatureResults/>
</DataTemplate>
<DataTemplate x:Key="FO3_Moisture">
<ui:Page_MoistureResults/>
</DataTemplate>
<DataTemplate x:Key="FO4_Dynamic">
<ui:Page_DynamicResults/>
</DataTemplate>
<!--Content Pages on right side-->
<Style x:Key="NavigationContentStyle" TargetType="ContentControl">
<!--Default First Page-->
<Setter Property="ContentTemplate" Value="{StaticResource FO0_ProjectPage}"/>
<!--
Switch between Pages based on 'SelectedItem' of 'NavigationMenuListBox'
Item value comes from 'ItemsSource' (type of ListBoxItem), or via 'Tag'
-->
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ProjectBoxHeader, Path=Tag}" Value="ProjectPage">
<Setter Property="ContentTemplate" Value="{StaticResource FO0_ProjectPage}"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=ProjectBoxHeader, Path=Tag}" Value="LandingPage">
<Setter Property="ContentTemplate" Value="{StaticResource FO1_ElementsPage}"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=NavigationMenuListBox, Path=SelectedItem}" Value="LayerSetup">
<Setter Property="ContentTemplate" Value="{StaticResource FO1_LayerSetup}"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=NavigationMenuListBox, Path=SelectedItem}" Value="Summary">
<Setter Property="ContentTemplate" Value="{StaticResource FO1_Summary}"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=NavigationMenuListBox, Path=SelectedItem}" Value="Temperature">
<Setter Property="ContentTemplate" Value="{StaticResource FO2_Temperature}"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=NavigationMenuListBox, Path=SelectedItem}" Value="Moisture">
<Setter Property="ContentTemplate" Value="{StaticResource FO3_Moisture}"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=NavigationMenuListBox, Path=SelectedItem}" Value="Dynamic">
<Setter Property="ContentTemplate" Value="{StaticResource FO4_Dynamic}"/>
</DataTrigger>
</Style.Triggers>
</Style>
<!--
NavigationMenu ListBoxItem values: Used in NavigationMenuListBox as ItemsSource
Used as Binding Values within the NavigationMenu to toggle between the pages
and set corresponding style of the ListBoxItem
-->
<x:Array x:Key="NavigationMenuItems" Type="system:String">
<system:String>Header1</system:String>
<system:String>LayerSetup</system:String> <!--SelectedIndex: 1-->
<system:String>Summary</system:String> <!--SelectedIndex: 2-->
<system:String>Header2</system:String>
<system:String>Temperature</system:String> <!--SelectedIndex: 4-->
<system:String>Moisture</system:String> <!--SelectedIndex: 5-->
<system:String>Dynamic</system:String> <!--SelectedIndex: 6-->
</x:Array>
<!--NavigationMenu ListBox appearance: Used in ListBox as Style -->
<Style x:Key="NavigationMenuListBoxStyle" TargetType="{x:Type ListBox}">
<Setter Property="Background" Value="{StaticResource PrimaryDarkBrush}"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Visibility" Value="Visible"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<!-- Nothing selected by default -->
<Setter Property="SelectedIndex" Value="-1"/>
<Setter Property="Padding" Value="8"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}">
<Border Background="{TemplateBinding Background}" BorderThickness="0" Padding="0" SnapsToDevicePixels="true">
<ScrollViewer Padding="{TemplateBinding Padding}" Focusable="false">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<!--Don't show ListBox when on the LandingPage and the first Header entry (acts like ListBoxItem) -->
<!--<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=NavigationMenuListBox, Path=SelectedItem}" Value="Header1">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=NavigationMenuListBox, Path=SelectedItem}" Value="LandingPage">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>-->
</Style>
<!--NavigationMenu ListBox entry appearance and behaviour: Used in ListBox as ItemContainerStyle-->
<Style x:Key="NavigationMenuItemStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{StaticResource PrimaryLightBrush}"/>
<Setter Property="Margin" Value="0,0,0,8"/>
<Setter Property="ToolTip" Value="{Binding}"/>
<Setter Property="Visibility" Value="Visible"/>
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<!--Triggers & Effects-->
<Style.Triggers>
<!--When a ListBox entry is NOT a Header, apply this Template-->
<DataTrigger Binding="{Binding Converter={StaticResource IsHeaderConverter}}" Value="False">
<!-- Template for the Button-like entries-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="listBox_Border"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}"
CornerRadius="8"
SnapsToDevicePixels="true">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
<!-- Triggers ONLY usable in this Template -->
<ControlTemplate.Triggers>
<!--When a ListBox entry is Selected-->
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="listBox_Border" Property="Background" Value="{StaticResource PrimaryDarkHighlightBrush}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource PrimaryHighlightBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<!--When a ListBox entry IS a Header, apply this Template-->
<DataTrigger Binding="{Binding Converter={StaticResource IsHeaderConverter}}" Value="True">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="IsEnabled" Value="False"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=NavigationMenuListBox, Path=SelectedIndex}" Value="-1">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
<!--
ListBox entry content: Used in ListBox as ItemTemplate
The Content Located inside of 'NavigationMenuItemStyle'
-->
<DataTemplate x:Key="NavigationMenuItemTemplate">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Image x:Name="MenuItemIcon" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="4" MaxWidth="24"/>
<Label x:Name="MenuItemLabel" Grid.Column="1" HorizontalContentAlignment="Center" Foreground="White" FontSize="14" Margin="0,4,4,4"/>
</Grid>
<!--
Binding is ItemsSource from 'NavigationMenuListBox'
Changes the Icon and Text of the entry based on the ItemsSource Values
-->
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding}" Value="Header1">
<Setter TargetName="MenuItemLabel" Property="Content" Value="BAUTEIL ERSTELLEN"/>
<Setter TargetName="MenuItemLabel" Property="Foreground" Value="{StaticResource PrimaryMediumBrush}"/>
<Setter TargetName="MenuItemLabel" Property="FontWeight" Value="Bold"/>
<Setter TargetName="MenuItemLabel" Property="FontSize" Value="12"/>
</DataTrigger>
<DataTrigger Binding="{Binding}" Value="LayerSetup">
<Setter TargetName="MenuItemIcon" Property="Source" Value="{StaticResource ButtonIcon_Layers_Flat}"/>
<Setter TargetName="MenuItemLabel" Property="Content" Value="Erstellen"/>
</DataTrigger>
<DataTrigger Binding="{Binding}" Value="Summary">
<Setter TargetName="MenuItemIcon" Property="Source" Value="{StaticResource ButtonIcon_Summary_Flat}"/>
<Setter TargetName="MenuItemLabel" Property="Content" Value="Zusammenfassung"/>
</DataTrigger>
<DataTrigger Binding="{Binding}" Value="Header2">
<Setter TargetName="MenuItemLabel" Property="Content" Value="ERGEBNISSE"/>
<Setter TargetName="MenuItemLabel" Property="Foreground" Value="{StaticResource PrimaryMediumBrush}"/>
<Setter TargetName="MenuItemLabel" Property="FontWeight" Value="Bold"/>
<Setter TargetName="MenuItemLabel" Property="FontSize" Value="12"/>
</DataTrigger>
<DataTrigger Binding="{Binding}" Value="Temperature">
<Setter TargetName="MenuItemIcon" Property="Source" Value="{StaticResource ButtonIcon_LayerTemps_Flat}"/>
<Setter TargetName="MenuItemLabel" Property="Content" Value="Temperaturkurve"/>
</DataTrigger>
<DataTrigger Binding="{Binding}" Value="Moisture">
<Setter TargetName="MenuItemIcon" Property="Source" Value="{StaticResource ButtonIcon_Glaser_Flat}"/>
<Setter TargetName="MenuItemLabel" Property="Content" Value="Glaser-Diagramm"/>
</DataTrigger>
<DataTrigger Binding="{Binding}" Value="Dynamic">
<Setter TargetName="MenuItemIcon" Property="Source" Value="{StaticResource ButtonIcon_Dynamic_Flat}"/>
<Setter TargetName="MenuItemLabel" Property="Content" Value="Dynamic"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
<Style x:Key="WindowMainPanelStyle" TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="{DynamicResource WindowBorderBrush}" />
<Setter Property="BorderThickness" Value="0" />
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=WindowState}" Value="Maximized">
<Setter Property="BorderThickness" Value="0" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="TitleBarButtonStyle" TargetType="Button">
<Setter Property="Foreground" Value="{DynamicResource WindowTextBrush}" />
<Setter Property="Padding" Value="0" />
<Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border
x:Name="border"
Background="Transparent"
BorderThickness="0"
SnapsToDevicePixels="true">
<ContentPresenter
x:Name="contentPresenter"
Margin="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Focusable="False"
RecognizesAccessKey="True" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="border" Property="Background" Value="{StaticResource PrimaryMediumBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="border" Property="Background" Value="{StaticResource PrimaryHoverBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TitleBarCloseButtonStyle" TargetType="Button">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Setter Property="Padding" Value="0" />
<Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border
x:Name="border"
Background="Transparent"
BorderThickness="0"
SnapsToDevicePixels="true">
<ContentPresenter
x:Name="contentPresenter"
Margin="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Focusable="False"
RecognizesAccessKey="True" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="border" Property="Background" Value="{StaticResource PrimaryMediumBrush}" />
<Setter Property="Foreground" Value="{DynamicResource MouseOverWindowCloseButtonForegroundBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="border" Property="Background" Value="{StaticResource PrimaryHighlightBrush}" />
<Setter Property="Foreground" Value="{DynamicResource MouseOverWindowCloseButtonForegroundBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Custom Toolbar Button: Text Only -->
<Style x:Key="TitleBarButtonStyle_B" TargetType="{x:Type Button}">
<!--Set default properties of the button-->
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Content" Value=""/>
<Setter Property="Tag" Value=""/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="MinWidth" Value="16"/>
<Setter Property="MinHeight" Value="16"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />
<!--Set appearance of the element-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<!--Element appearance with behaviour of a 'Button'-->
<Border CornerRadius="0" Background="{TemplateBinding Background}">
<StackPanel Orientation="Horizontal">
<Image x:Name="ButtonIcon" Source="{TemplateBinding Tag}" Stretch="Fill" Width="18" Height="18" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,10,0"/>
<Label x:Name="ButtonLabel" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" FontSize="12" Margin="0,0,8,0"/>
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Content" Value="">
<Setter TargetName="ButtonLabel" Property="Visibility" Value="Collapsed"/>
<Setter TargetName="ButtonLabel" Property="Margin" Value="0"/>
<Setter TargetName="ButtonLabel" Property="Padding" Value="0"/>
</Trigger>
<Trigger Property="Tag" Value="">
<Setter TargetName="ButtonIcon" Property="Visibility" Value="Collapsed"/>
<Setter TargetName="ButtonIcon" Property="Margin" Value="0"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<!--Set Triggers and Effects-->
<Style.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{StaticResource PrimaryBorderBrush}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource PrimaryHoverBrush}"/>
<Setter Property="BorderThickness" Value="4"/>
<Setter Property="BorderBrush" Value="{StaticResource PrimaryDarkBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX=".96" ScaleY=".96" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Window.InputBindings>
<KeyBinding
Key="N"
Command="{Binding NewCommand}"
Modifiers="Control" />
<KeyBinding
Key="S"
Command="{Binding SaveCommand}"
Modifiers="Control" />
<KeyBinding
Key="O"
Command="{Binding OpenCommand}"
Modifiers="Control" />
<KeyBinding
Key="O"
Command="{Binding OpenCommand}"
Modifiers="Control+Shift" />
</Window.InputBindings>
<Border Name="RootGrid" Style="{StaticResource WindowMainPanelStyle}">
<Grid Name="ContentGrid">
<Grid.RowDefinitions>
<!-- Title bar -->
<RowDefinition Height="30" />
<!-- Main Grid for Content -->
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Title bar -->
<Grid Grid.Row="0" Background="{StaticResource PrimaryLightBrush}" VerticalAlignment="Top">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="{StaticResource Favicon}" Stretch="Fill" MinWidth="16" MinHeight="16" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,4"/>
<Label Content="Bauphysik Tool" FontSize="12" VerticalAlignment="Center" Margin="0,0,16,0"/>
<Button ToolTip="Neues Projekt" Style="{StaticResource TitleBarButtonStyle_B}" Tag="{StaticResource ButtonIcon_NewProject_Flat}" Command="{Binding NewCommand}" Margin="4,0"/>
<Button ToolTip="Projekt speichern" Style="{StaticResource TitleBarButtonStyle_B}" Tag="{StaticResource ButtonIcon_Save_Flat}" Command="{Binding SaveCommand}" Margin="4,0"/>
<Button ToolTip="Projekt speichern unter" Style="{StaticResource TitleBarButtonStyle_B}" Tag="{StaticResource ButtonIcon_SaveTo_Flat}" Command="{Binding SaveToCommand}" Margin="4,0"/>
<Button ToolTip="Projekt öffnen" Style="{StaticResource TitleBarButtonStyle_B}" Tag="{StaticResource ButtonIcon_OpenFile_Flat}" Command="{Binding OpenCommand}" Margin="4,0"/>
<Button ToolTip="Programm Infos" Style="{StaticResource TitleBarButtonStyle_B}" Tag="{StaticResource ButtonIcon_Info_Flat}" Command="{Binding ShowInfoCommand}" Margin="4,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="8,0" VerticalAlignment="Center" HorizontalAlignment="Center">
<Label Content="{Binding Title}" FontSize="12"/>
<Ellipse Fill="{Binding IsEditedTagColorCode}" Width="8" Height="8"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Click="MinimizeCommand" RenderOptions.EdgeMode="Aliased" Style="{StaticResource TitleBarButtonStyle}">
<Path
Width="46"
Height="32"
Data="M 18,15 H 28"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1" />
</Button>
<Button Name="MaximizeButton" Click="MaximizeCommand" Style="{StaticResource TitleBarButtonStyle}">
<Path
Width="46"
Height="32"
Data="M 18.5,10.5 H 27.5 V 19.5 H 18.5 Z"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1" />
</Button>
<Button Name="RestoreButton" Click="MaximizeCommand" Style="{StaticResource TitleBarButtonStyle}">
<Path
Width="46"
Height="32"
Data="M 18.5,12.5 H 25.5 V 19.5 H 18.5 Z M 20.5,12.5 V 10.5 H 27.5 V 17.5 H 25.5"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1" />
</Button>
<Button Name="CloseButton" Click="CloseCommand" Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Width="46"
Height="32"
Data="M 18,11 27,20 M 18,20 27,11"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1" />
</Button>
</StackPanel>
</Grid>
<!-- Main Grid for Content -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Left Selection Box Top-->
<Border x:Name="ProjectBoxHeader" Grid.Column="0" Grid.Row="0" Background="{StaticResource PrimaryDarkHighlightBrush}" BorderThickness="0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" MaxHeight="120"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Margin="16,16,16,0">
<Label Content="Projekt:" Foreground="White" Margin="-4"/>
<TextBlock Text="{Binding ProjectName}" MaxWidth="152" FontWeight="Bold" Foreground="White" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" FontSize="14"/>
</StackPanel>
<Button Grid.Row="1" Content="Projektdaten" Style="{StaticResource ButtonStyle01}" Tag="{StaticResource ButtonIcon_House_B}" Command="{Binding SwitchPageCommand}" CommandParameter="{x:Static local:NavigationContent.ProjectPage}" Margin="16"/>
<Button Grid.Row="2" Content="Bauteilkatalog" Style="{StaticResource ButtonStyle01}" Tag="{StaticResource ButtonIcon_Elements_B}" Command="{Binding SwitchPageCommand}" CommandParameter="{x:Static local:NavigationContent.LandingPage}" Margin="16,0,16,16"/>
</Grid>
</Border>
<!--Left Selection Box Bottom-->
<ListBox x:Name="NavigationMenuListBox"
Grid.Column="0"
Grid.Row="1"
Style="{StaticResource NavigationMenuListBoxStyle}"
ItemsSource="{StaticResource NavigationMenuItems}"
ItemContainerStyle="{DynamicResource NavigationMenuItemStyle}"
ItemTemplate="{DynamicResource NavigationMenuItemTemplate}"/>
<!--The Actual Pages shown here-->
<ContentControl x:Name="MainWindowContent" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Style="{StaticResource NavigationContentStyle}"/>
<!--Toast Notification-->
<controls:ToastNotification x:Name="Toast" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Visibility="Collapsed" HorizontalAlignment="Stretch" VerticalAlignment="Top"/>
</Grid>
</Grid>
</Border>
</Window>