-
Notifications
You must be signed in to change notification settings - Fork 25
/
MainWindow.xaml
528 lines (509 loc) · 44.4 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
<controls:MetroWindow x:Class="CompilePalX.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:dialogs="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
xmlns:local="clr-namespace:CompilePalX"
xmlns:config="clr-namespace:CompilePalX.Configuration"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:compilePalX="clr-namespace:CompilePalX"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Name="CompileWindow"
Title="Compile Pal X"
MinHeight="595" MinWidth="850"
Height="595" Width="850"
Closing="MetroWindow_Closing"
IconEdgeMode="Aliased" Icon="CompilePalIcon.ico" ShowIconOnTitleBar="False"
Activated="MetroWindow_Activated"
BorderThickness="1"
BorderBrush="{DynamicResource MahApps.Brushes.Accent}"
>
<controls:MetroWindow.LeftWindowCommands>
<controls:WindowCommands>
<Button Click="ConfigBack_OnClick" ToolTip="Open Game Selector" x:Name="ConfigSelectButton">
<iconPacks:Material Kind="Menu" />
</Button>
</controls:WindowCommands>
</controls:MetroWindow.LeftWindowCommands>
<controls:MetroWindow.RightWindowCommands>
<controls:WindowCommands>
<Button Click="BugReportButton_OnClick" ToolTip="Report a bug" x:Name="BugReportButton">
<iconPacks:Material Kind="Bug" />
</Button>
</controls:WindowCommands>
</controls:MetroWindow.RightWindowCommands>
<controls:MetroWindow.WindowButtonCommands>
<controls:WindowButtonCommands LightCloseButtonStyle="{StaticResource LightButtonStyle}" LightMinButtonStyle="{StaticResource LightButtonStyle}" LightMaxButtonStyle="{StaticResource LightButtonStyle}"/>
</controls:MetroWindow.WindowButtonCommands>
<controls:MetroWindow.Resources>
<Style x:Key="GroupListBoxStyle" TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
<Setter Property="Margin" Value="-5, 0, 0, 0" />
<Setter Property="Padding" Value="10, 0, 0, 0" />
<Style.Triggers>
<DataTrigger Binding="{Binding Items.Groups.Count, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}" Value="1">
<Setter Property="Padding" Value="5, 0, 0, 0" />
</DataTrigger>
</Style.Triggers>
</Style>
</controls:MetroWindow.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="80" MinHeight="80" MaxHeight="240"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<ListBox x:Name="MapListBox" Grid.Row="0" Margin="10,10,95,0" BorderBrush="{DynamicResource MahApps.Brushes.Accent}" SelectionChanged="MapListBox_OnSelectionChanged" BorderThickness="2" SelectionMode="Single">
<ListBox.ItemTemplate>
<DataTemplate>
<DockPanel HorizontalAlignment="Stretch">
<TextBlock Text="{Binding File}" Margin="0, 0, 5, 0"/>
<TextBlock Text="{Binding Path=Preset.Name, StringFormat=({0})}" Margin="0, 0, 5, 0" Foreground="{StaticResource MahApps.Brushes.Gray1}" FontWeight="SemiBold" Name="selectedPreset"/>
<CheckBox IsChecked="{Binding Compile, Mode=TwoWay}" HorizontalAlignment="Right" />
</DockPanel>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Value="True">
<Setter Property="Opacity" Value="0.7" TargetName="selectedPreset"/>
<Setter Property="Foreground" Value="{StaticResource MahApps.Brushes.IdealForeground}" TargetName="selectedPreset"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button x:Name="AddMapButton" Grid.Row="0" Content="Add Map" Margin="0,10,10,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="75" Click="AddMapButton_Click"/>
<Button x:Name="RemoveMapButton" Grid.Row="0" Content="Remove" Margin="0,45,10,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="75" Click="RemoveMapButton_Click"/>
<GridSplitter Grid.Row="1" Height="2" HorizontalAlignment="Stretch" Width="512"></GridSplitter>
<controls:MetroTabControl Grid.Row="2" controls:TabControlHelper.Underlined="SelectedTabItem" controls:TabControlHelper.Transition="LeftReplace" Margin="10,10,10,40">
<controls:MetroTabItem Header="CONFIG">
<Grid Background="{StaticResource CompilePal.Brushes.GridBackground}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="135"/>
<ColumnDefinition Width="Auto" MinWidth="135"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Margin="10,10,0,10" Background="{StaticResource CompilePal.Brushes.DockBackground}">
<DockPanel Background="{StaticResource CompilePal.Brushes.GridBackground}" Height="30" Margin="0, -5, 0, 0">
<Button x:Name="AddPresetButton" MinHeight="25" Height="25" Width="25" Padding="0" Margin="0, 0, 0, 5" Click="AddPresetButton_Click" ToolTip="Add Preset" DockPanel.Dock="Right">
<iconPacks:Material Kind="Plus" Height="10" Width="10"/>
</Button>
<ToggleButton x:Name="FilterPresetButton" MinHeight="25" Height="25" Width="25" Padding="0" Margin="0, 0, 3, 5" DockPanel.Dock="Right" IsChecked="{Binding ElementName=CompileWindow, Path=PresetFilterEnabled, Mode=OneWay}" Checked="FilterPresetButton_OnChecked" Unchecked="FilterPresetButton_OnChecked">
<ToggleButton.Style>
<Style TargetType="ToggleButton" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Style.Triggers>
<Trigger Property="IsChecked" Value="False">
<Setter Property="Content">
<Setter.Value>
<iconPacks:Material Kind="Filter" Height="10" Width="10"/>
</Setter.Value>
</Setter>
<Setter Property="ToolTip" Value="Filter Presets"/>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Content">
<Setter.Value>
<iconPacks:Material Kind="FilterRemove" Height="10" Width="10"/>
</Setter.Value>
</Setter>
<Setter Property="Background" Value="{StaticResource MahApps.Brushes.Gray10}"/>
<Setter Property="ToolTip" Value="Show All Presets"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource MahApps.Brushes.Button.Square.Background.MouseOver}"/>
</Trigger>
</Style.Triggers>
</Style>
</ToggleButton.Style>
</ToggleButton>
<TextBlock FontSize="16" Margin="0, 0, 0, 5" FontWeight="SemiBold">Preset</TextBlock>
</DockPanel>
<ListBox Name="PresetConfigListBox" Margin="0,0,0,5" SelectionChanged="PresetConfigListBox_SelectionChanged" SelectionMode="Single" ItemContainerStyle="{StaticResource GroupListBoxStyle}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}" Margin="0, 0, 5, 0"/>
<Button Name="PresetKebabButton" Grid.Column="1" Height="5" Width="15" Padding="0" Margin="0, -8, 0, -8" Visibility="Collapsed" Foreground="White" ContextMenuOpening="PresetActionButton_OnContextMenuOpening" Click="PresetActionButton_OnClick" IsEnabled="{Binding ElementName=PresetConfigListBox, Path=IsEnabled}" controls:ControlsHelper.CornerRadius="0" controls:ControlsHelper.FocusBorderThickness="0">
<iconPacks:PackIconMaterial Kind="DotsVertical" Height="8" Width="8"/>
<Button.ContextMenu>
<ContextMenu Name="PresetActionMenu" Placement="Bottom">
<MenuItem Header="Edit" Click="EditPresetButton_OnClick" />
<MenuItem Header="Clone" Click="ClonePresetButton_OnClick"/>
<MenuItem Header="Delete" Click="RemovePresetButton_OnClick"/>
</ContextMenu>
</Button.ContextMenu>
<Button.Style>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<!-- #region HorribleHackForBackgroundHoverColor -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ButtonBase}">
<Grid>
<Border x:Name="Border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(controls:ControlsHelper.CornerRadius), Mode=OneWay}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Border x:Name="DisabledVisualElement"
Background="{DynamicResource ControlsDisabledBrush}"
CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(controls:ControlsHelper.CornerRadius), Mode=OneWay}"
IsHitTestVisible="False"
Opacity="0"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<controls:ContentControlEx
x:Name="PART_ContentPresenter"
Margin="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentCharacterCasing="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(controls:ControlsHelper.ContentCharacterCasing)}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border"
Property="Background"
Value="{DynamicResource GrayBrush8}" />
<!-- set it to what you need -->
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Border"
Property="Background"
Value="{DynamicResource GrayBrush7}" />
</Trigger>
<Trigger Property="IsKeyboardFocusWithin"
Value="True">
<Setter TargetName="Border"
Property="BorderBrush"
Value="{DynamicResource ButtonMouseOverBorderBrush}" />
<!--
<Setter TargetName="Border"
Property="BorderThickness" Value="2" />
-->
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="DisabledVisualElement"
Property="Opacity" Value="0.7" />
<Setter TargetName="PART_ContentPresenter"
Property="Opacity" Value="0.3" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<!-- #endregion -->
<Style.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{StaticResource MahApps.Colors.Gray10}" Opacity="0.25"/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{StaticResource MahApps.Colors.Gray10}" Opacity="0.4"/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{StaticResource MahApps.Colors.Gray10}" Opacity="0.25"/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{StaticResource MahApps.Colors.Gray10}" Opacity="0.25"/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Value="True">
<Setter TargetName="PresetKebabButton" Property="Visibility" Value="Visible"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<TextBlock x:Name="PresetHeaderBlock" FontWeight="Bold" FontSize="12" Text="{Binding Name}" Margin="5, 2, 5, 0"/>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Name}" Value="{x:Null}">
<Setter TargetName="PresetHeaderBlock" Property="Text" Value="Global"/>
</DataTrigger>
<DataTrigger Binding="{Binding Items.Groups.Count, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}" Value="1">
<Setter TargetName="PresetHeaderBlock" Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</ListBox.GroupStyle>
</ListBox>
</StackPanel>
<DockPanel Grid.Column="1" Margin="10,10,0,10" Background="{StaticResource CompilePal.Brushes.DockBackground}">
<DockPanel DockPanel.Dock="Top" Background="{StaticResource CompilePal.Brushes.GridBackground}" Height="30" Margin="0, -5, 0, 0">
<Button x:Name="AddProcessesButton" MinHeight="25" Height="25" Width="25" Padding="0" Margin="0, 0, 0, 5" Click="AddProcessButton_Click" DockPanel.Dock="Right" ToolTip="Add Process">
<iconPacks:Material Kind="Plus" Height="10" Width="10"/>
</Button>
<Button x:Name="RemoveProcessesButton" MinHeight="25" Height="25" Width="25" Padding="0" Margin="0, 0, 3, 5" Click="RemoveProcessButton_Click" DockPanel.Dock="Right" ToolTip="Remove Process">
<iconPacks:Material Kind="Minus" Height="10" Width="10"/>
</Button>
<TextBlock FontSize="16" Margin="0, 0, 0, 5" FontWeight="SemiBold">Process</TextBlock>
</DockPanel>
<ListBox x:Name ="CompileProcessesListBox" Margin="0,0,0,5" Grid.Row="0" SelectionChanged="CompileProcessesListBox_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<DockPanel Name="ProcessDockPanel" HorizontalAlignment="Stretch">
<TextBlock VerticalAlignment="Center" Text="{Binding}" Margin="0, 0, 5, 0"/>
<iconPacks:PackIconMaterial VerticalAlignment="Center" Kind="Alert" Foreground="Orange" Margin="0, 0, 5, 0" ToolTip="This process is potentially incompatible with the current game">
<iconPacks:PackIconMaterial.Style>
<Style TargetType="iconPacks:PackIconMaterial">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsCompatible}" Value="False">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</iconPacks:PackIconMaterial.Style>
</iconPacks:PackIconMaterial>
<CheckBox x:Name="ProcessCheckbox" IsChecked="{Binding DoRun, Mode=TwoWay}" HorizontalAlignment="Right" Click="DoRun_OnClick" controls:CheckBoxHelper.CheckBackgroundFillUncheckedDisabled="LightGray" ToolTipService.ShowOnDisabled="True"/>
</DockPanel>
<DataTemplate.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=SelectedItem.IsBSP, ElementName=MapListBox}" Value="True"/>
<Condition Binding="{Binding SupportsBSP}" Value="False"/>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter TargetName="ProcessCheckbox" Property="IsChecked" Value="False"/>
<Setter TargetName="ProcessCheckbox" Property="ToolTip" Value="This process does not support BSP files"/>
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=SelectedItem.IsBSP, ElementName=MapListBox}" Value="True"/>
<Condition Binding="{Binding SupportsBSP}" Value="False"/>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter Property="IsEnabled" Value="False"/>
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</DockPanel>
<Grid Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="35px"/>
<RowDefinition/>
</Grid.RowDefinitions>
<DockPanel Background="{StaticResource CompilePal.Brushes.GridBackground}" Height="25" Margin="10, 0, 10, 0">
<TextBlock TextAlignment="Right" FontSize="16" Margin="0, 0, 0, 0" FontWeight="SemiBold" DockPanel.Dock="Left">Parameters</TextBlock>
<Button Name="AddParameterButton" DockPanel.Dock="Right" MinHeight="25" Height="25" Width="25" Padding="0" Margin="0, 0, 3, 0" Click="AddParameterButton_Click" ToolTip="Add Parameter">
<iconPacks:Material Kind="Plus" Height="10" Width="10"/>
</Button>
<Button Name="RemoveParameterButton" DockPanel.Dock="Right" MinHeight="25" Height="25" Width="25" Padding="0" Margin="0, 0, 3, 0" Click="RemoveParameterButton_OnClickParameterButton_Click" ToolTip="Remove Parameter">
<iconPacks:Material Kind="Minus" Height="10" Width="10"/>
</Button>
<TextBox Name="ParametersTextBox" Margin="20,0, 20,0" IsEnabled="True" IsReadOnly="True" Background="{StaticResource MahApps.Brushes.Gray.SemiTransparent}" FontWeight="DemiBold" BorderThickness="0"/>
</DockPanel>
<DataGrid Grid.Row ="1" Name="ConfigDataGrid" Margin="10,0,10,10" AutoGenerateColumns="False" CanUserAddRows="False" ItemsSource="{Binding}">
<DataGrid.Columns>
<DataGridTemplateColumn Header="Name" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" Margin="5, 0, 5, 0"/>
<iconPacks:PackIconMaterial Kind="Alert" Foreground="{StaticResource CompilePal.Brushes.Warning}" Margin="0, 0, 5, 0" ToolTip="This parameter is potentially incompatible with the current game">
<iconPacks:PackIconMaterial.Style>
<Style TargetType="iconPacks:PackIconMaterial">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsCompatible}" Value="False">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</iconPacks:PackIconMaterial.Style>
</iconPacks:PackIconMaterial>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Value">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<TextBox Text="{Binding Value, UpdateSourceTrigger=PropertyChanged}" KeyUp="OnConfigChanged">
<TextBox.Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ValueIsFile}" Value="True">
<Setter Property="Visibility" Value="Hidden"/>
</DataTrigger>
<DataTrigger Binding="{Binding ValueIsFolder}" Value="True">
<Setter Property="Visibility" Value="Hidden"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
<local:FileInput Config="{Binding}" FileDialogTitle="Choose File" IsFolder="{Binding ValueIsFolder}">
<local:FileInput.Style>
<Style TargetType="{x:Type local:FileInput}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding ValueIsFile}" Value="False"/>
<Condition Binding="{Binding ValueIsFolder}" Value="False"/>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter Property="Visibility" Value="Hidden"/>
</MultiDataTrigger.Setters>
</MultiDataTrigger>
<DataTrigger Binding="{Binding ValueIsFolder}" Value="True">
<Setter Property="Hint" Value="Choose Folder"/>
</DataTrigger>
</Style.Triggers>
</Style>
</local:FileInput.Style>
</local:FileInput>
<Grid.Style>
<Style TargetType="{x:Type Grid}">
<Style.Triggers>
<DataTrigger Binding="{Binding CanHaveValue}" Value="False">
<Setter Property="Visibility" Value="Hidden"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="Description" Binding="{ Binding Description}" IsReadOnly="True"/>
<DataGridTextColumn Header="Warnings" Binding="{ Binding Warning}" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
<controls:MetroTabControl Grid.Row="0" Visibility="Hidden" controls:TabControlHelper.Underlined="SelectedTabItem" Name="ProcessTab" IsEnabled="False" SelectionChanged="ProcessTab_OnSelectionChanged" Background="Transparent">
<controls:MetroTabItem Header="PROGRAMS" Margin="5, 0, 0, 0" x:Name="ProgramTab" Background="Transparent">
<DataGrid IsEnabled="False" Visibility="Visible" Name="ProcessDataGrid" Margin="10,10,10,10" AutoGenerateColumns="False" CanUserAddRows="False" ItemsSource="{Binding}">
<DataGrid.Columns>
<DataGridTemplateColumn Header="Program Path" CanUserSort="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<local:FileInput Config="{Binding}" FileDialogTitle="Choose Program"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Command Line Arguments" CanUserSort="False" Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Value2, UpdateSourceTrigger=PropertyChanged}" KeyUp="OnConfigChanged"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridCheckBoxColumn Header="Read Output" Binding="{Binding ReadOutput, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ElementStyle="{DynamicResource MetroDataGridCheckBox}" EditingElementStyle="{DynamicResource MetroDataGridCheckBox}" CanUserSort="False"/>
<DataGridCheckBoxColumn Header="Wait For Exit" Binding="{Binding WaitForExit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ElementStyle="{DynamicResource MetroDataGridCheckBox}" EditingElementStyle="{DynamicResource MetroDataGridCheckBox}" CanUserSort="False"/>
</DataGrid.Columns>
</DataGrid>
</controls:MetroTabItem>
<controls:MetroTabItem Header="ORDER" Margin="5, 0, 0, 0" IsEnabledChanged="OrderGrid_OnIsEnabledChanged" x:Name="OrderTab" Background="Transparent">
<DataGrid Name="OrderGrid" Margin="10,10,10,10" AutoGenerateColumns="False" CanUserAddRows="False" SelectionMode="Single" ItemsSource="{Binding Source={x:Static config:OrderManager.CurrentOrder}}" local:RowDragHelper.EnableRowDrag="True">
<DataGrid.Columns>
<DataGridTextColumn Header="Original Order" Binding="{ Binding Ordering}" IsReadOnly="True" CanUserSort="False"/>
<DataGridTextColumn Header="Name" Binding="{ Binding Name}" IsReadOnly="True" Width="*" CanUserSort="False"/>
<DataGridTextColumn Header="Description" Binding="{ Binding Description}" IsReadOnly="True" Width="*" CanUserSort="False"/>
</DataGrid.Columns>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Style.Triggers>
<DataTrigger Binding="{Binding IsDraggable}" Value="False">
<Setter Property="Background" Value="{StaticResource CompilePal.Brushes.GridBackground}"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Foreground" Value="Black"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsDraggable}" Value="True">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style.Setters>
<EventSetter Event="MouseEnter" Handler="DataGridCell_OnEnter"/>
<EventSetter Event="MouseLeave" Handler="DataGridCell_OnExit"/>
</Style.Setters>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="{x:Static SystemColors.HighlightColor}"/>
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="{x:Static SystemColors.HighlightTextColor}"/>
</DataGrid.Resources>
</DataGrid>
</controls:MetroTabItem>
</controls:MetroTabControl>
</Grid>
</Grid>
</controls:MetroTabItem>
<controls:MetroTabItem Name="OutputTab" Header="OUTPUT">
<Grid Background="{StaticResource CompilePal.Brushes.GridBackground}">
<RichTextBox IsReadOnly="True" x:Name="CompileOutputTextbox" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" BorderThickness="0" Margin="10,10,10,10" FontFamily="Segoe UI, Lucida Sans Unicode, Verdana" IsReadOnlyCaretVisible="True" Block.LineHeight="2" IsDocumentEnabled="True">
<RichTextBox.Document>
<FlowDocument>
<Paragraph Name="OutputParagraph"/>
</FlowDocument>
</RichTextBox.Document>
</RichTextBox>
</Grid>
</controls:MetroTabItem>
</controls:MetroTabControl>
<StackPanel Grid.Row="2" VerticalAlignment="Bottom" HorizontalAlignment="Right" Orientation="Horizontal" Margin="10,0,10,0">
<ProgressBar Name="CompileProgressBar" Margin="0,0,0,7" Height="27" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="200"/>
<Button Name="CopyButton" Margin="5,10,0,6" Width="35" Click="CopyButton_OnClick" ToolTip="Copy Output">
<iconPacks:Material Height="15" Kind="ContentCopy" />
</Button>
<Button Name="CompileStartStopButton" Content="Compile" Margin="5,10,0,6" Width="75" Click="CompileStartStopButton_OnClick" IsEnabled="{Binding ElementName=MapListBox, Path=Items.Count}"/>
</StackPanel>
<Label Name="UpdateLabel" Visibility="Collapsed" Grid.Row="2" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="10" MouseLeftButtonUp="UpdateLabel_MouseLeftButtonUp" >
<Hyperlink Name="UpdateHyperLink" NavigateUri="https://github.com/ruarai/CompilePal/releases/latest" RequestNavigate="UpdateHyperLink_OnRequestNavigate" Foreground="{StaticResource CompilePal.Brushes.Link}"/>
</Label>
<Label Name="TimeElapsedLabel" Visibility="Collapsed" Grid.Row="2" VerticalAlignment="Bottom" FontWeight="Bold" HorizontalAlignment="Left" Margin="10" />
</Grid>
<Window.TaskbarItemInfo>
<TaskbarItemInfo/>
</Window.TaskbarItemInfo>
</controls:MetroWindow>