-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
127 lines (127 loc) · 7.33 KB
/
MainWindow.xaml
File metadata and controls
127 lines (127 loc) · 7.33 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
<mah:MetroWindow
x:Class="BWI_Hardwareverteilung.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:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:local="clr-namespace:BWI_Hardwareverteilung"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodels="clr-namespace:BWI_Hardwareverteilung.ViewModels"
Title="Optimaler Verteilungsrechner"
Width="800"
Height="450"
DataContext="{DynamicResource MainViewModelDataContext}"
mc:Ignorable="d">
<mah:MetroWindow.Resources>
<viewmodels:MainViewModel x:Key="MainViewModelDataContext" />
</mah:MetroWindow.Resources>
<Grid>
<!-- Tab Control für Dateneingabe & Datenausgabe -->
<TabControl Style="{StaticResource MahApps.Styles.TabControl.Animated}" SelectionChanged="TabControl_SelectionChanged">
<!-- Tab für die Dateneingabe -->
<TabItem Header="Dateneingabe">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="160" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<!-- Buttons um eingebene Daten zu exportieren oder um Daten zu importieren -->
<GroupBox
Grid.Row="0"
Margin="10"
Header="Daten exportieren und importieren">
<StackPanel>
<!-- Button um Daten zu importieren -->
<Button Margin="10" Click="ImportData_Click">
<StackPanel Orientation="Horizontal">
<iconPacks:PackIconMaterialDesign
Margin="0,0,10,0"
VerticalAlignment="Center"
Kind="FileUpload" />
<TextBlock FontFamily="Roboto" FontSize="15">
Daten importieren
</TextBlock>
</StackPanel>
</Button>
<!-- Button um Daten zu exportieren -->
<Button Margin="10" Click="ExportData_Click">
<StackPanel Orientation="Horizontal">
<iconPacks:PackIconMaterialDesign
Margin="0,0,10,0"
VerticalAlignment="Center"
Kind="CloudDownload" />
<TextBlock FontFamily="Roboto" FontSize="15">
Eingegebene Daten exportieren
</TextBlock>
</StackPanel>
</Button>
</StackPanel>
</GroupBox>
<!-- Felder zum Eingeben der Daten -->
<GroupBox
Grid.Row="1"
Margin="10"
Header="Eingabe der Daten">
<ScrollViewer>
<StackPanel>
<!-- Info Panel mit kurzen Erlöuterungen zur Eingabe von Daten-->
<StackPanel Orientation="Horizontal" Margin="0, 5, 0, 10">
<iconPacks:PackIconMaterialDesign
Width="32"
Height="32"
VerticalAlignment="Center"
Kind="InfoOutline" />
<Grid Margin="10, 0, 0, 0">
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"></RowDefinition>
<RowDefinition Height="0.5*"></RowDefinition>
<RowDefinition Height="0.5*"></RowDefinition>
</Grid.RowDefinitions>
<!-- Erklärungssätze für die Dateneingabe-->
<TextBlock Grid.Row="0" FontSize="14" FontFamily="Roboto" Text="1. Du kannst mit einem Doppelklick unterhalb der letzten Zeile, neue Dateneinträge hinzufügen."></TextBlock>
<TextBlock Grid.Row="1" FontSize="14" FontFamily="Roboto" Text="2. Mit einem Doppelklick auf bestimmte Daten, kannst du diese verändern."></TextBlock>
<TextBlock Grid.Row="2" FontSize="14" FontFamily="Roboto" Text="3. Um Einträge zu entfernen, wähle die jeweilige Zeile mit einem Mausklick aus und drücke dann die Entfernen-Taste."></TextBlock>
</Grid>
</StackPanel>
<!-- Transportliste zum bearbeiten-->
<TextBlock
FontFamily="Roboto"
FontSize="16"
FontWeight="Medium"
Text="Transporterdaten" />
<DataGrid AutoGenerateColumns="True" ItemsSource="{Binding TransporterList}" />
<!-- Objektliste zum bearbeiten-->
<TextBlock
FontFamily="Roboto"
FontSize="16"
FontWeight="Medium"
Text="Objektdaten" />
<DataGrid AutoGenerateColumns="True" ItemsSource="{Binding TransportableObjectsList}" />
</StackPanel>
</ScrollViewer>
</GroupBox>
</Grid>
</TabItem>
<!-- Tab für die Datenausgabe -->
<TabItem Header="Optimale Verteilung" MouseDown="Partition_Click">
<StackPanel>
<GroupBox Header="Score" Margin="4">
<TextBlock Text="{Binding ResultScore}" FontSize="20" FontFamily="Roboto"></TextBlock>
</GroupBox>
<ScrollViewer VerticalScrollBarVisibility="Auto" >
<ListView ItemsSource="{Binding TransporterList}">
<ListView.ItemTemplate>
<DataTemplate>
<GroupBox Header="{Binding TruckName}">
<TextBlock Text="{Binding ResultText}"></TextBlock>
</GroupBox>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollViewer>
</StackPanel>
</TabItem>
</TabControl>
</Grid>
</mah:MetroWindow>