-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
815 lines (789 loc) · 42.6 KB
/
Copy pathMainWindow.xaml
File metadata and controls
815 lines (789 loc) · 42.6 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
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
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
<Window x:Class="BARS_Client_V2.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:BARS_Client_V2"
mc:Ignorable="d"
Title="BARS Client"
Height="674"
Width="600"
Background="#1E1E1E"
FontFamily="Segoe UI"
WindowStartupLocation="CenterScreen"
ResizeMode="NoResize">
<Window.Resources>
<!-- Converters -->
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<local:NullOrEmptyToVisibilityConverter x:Key="NullOrEmptyToVisibilityConverter"/>
<!-- Animation Resources -->
<Storyboard x:Key="FadeIn">
<DoubleAnimation Storyboard.TargetProperty="Opacity"
From="0.0"
To="1.0"
Duration="0:0:0.3">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
<Storyboard x:Key="SlideUp">
<ThicknessAnimation Storyboard.TargetProperty="Margin"
From="0,20,0,0"
To="0,0,0,0"
Duration="0:0:0.3">
<ThicknessAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</ThicknessAnimation.EasingFunction>
</ThicknessAnimation>
</Storyboard>
<Style TargetType="Button">
<Setter Property="Background"
Value="#2D2D30"/>
<Setter Property="Foreground"
Value="White"/>
<Setter Property="Padding"
Value="10,5"/>
<Setter Property="BorderBrush"
Value="#3E3E42"/>
<Setter Property="BorderThickness"
Value="1"/>
<Setter Property="Cursor"
Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="3">
<ContentPresenter x:Name="contentPresenter"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetName="border"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
To="White"
Duration="0:0:0.15"/>
<ColorAnimation Storyboard.TargetName="contentPresenter"
Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)"
To="#2D2D30"
Duration="0:0:0.15"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetName="border"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
To="#2D2D30"
Duration="0:0:0.15"/>
<ColorAnimation Storyboard.TargetName="contentPresenter"
Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)"
To="White"
Duration="0:0:0.15"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="PreviewMouseDown">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="border"
Storyboard.TargetProperty="Opacity"
To="0.8"
Duration="0:0:0.05"/>
<DoubleAnimation Storyboard.TargetName="border"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
To="0.98"
Duration="0:0:0.05"/>
<DoubleAnimation Storyboard.TargetName="border"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
To="0.98"
Duration="0:0:0.05"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="PreviewMouseUp">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="border"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0:0:0.05"/>
<DoubleAnimation Storyboard.TargetName="border"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
To="1"
Duration="0:0:0.05"/>
<DoubleAnimation Storyboard.TargetName="border"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
To="1"
Duration="0:0:0.05"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</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>
<Style TargetType="TextBox">
<Setter Property="Background"
Value="#333337"/>
<Setter Property="Foreground"
Value="White"/>
<Setter Property="BorderBrush"
Value="#3E3E42"/>
<Setter Property="BorderThickness"
Value="1"/>
<Setter Property="Padding"
Value="5"/>
<Setter Property="Height"
Value="30"/>
<Setter Property="Cursor"
Value="IBeam"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer x:Name="PART_ContentHost"
Focusable="false"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="BorderBrush"
Value="#007ACC"
TargetName="border"/>
</Trigger>
<Trigger Property="IsFocused"
Value="True">
<Setter Property="BorderBrush"
Value="#66BCFF"
TargetName="border"/>
<Setter Property="BorderThickness"
Value="2"
TargetName="border"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Custom style for PasswordBox to match TextBox style -->
<Style TargetType="PasswordBox">
<Setter Property="Background"
Value="#333337"/>
<Setter Property="Foreground"
Value="White"/>
<Setter Property="BorderBrush"
Value="#3E3E42"/>
<Setter Property="BorderThickness"
Value="1"/>
<Setter Property="Padding"
Value="5"/>
<Setter Property="Height"
Value="30"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="PasswordBox">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer x:Name="PART_ContentHost"
Focusable="false"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="BorderBrush"
Value="#007ACC"
TargetName="border"/>
</Trigger>
<Trigger Property="IsFocused"
Value="True">
<Setter Property="BorderBrush"
Value="#66BCFF"
TargetName="border"/>
<Setter Property="BorderThickness"
Value="2"
TargetName="border"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ComboBox">
<Setter Property="Background"
Value="#333337"/>
<Setter Property="Foreground"
Value="White"/>
<Setter Property="BorderBrush"
Value="#3E3E42"/>
<Setter Property="BorderThickness"
Value="1"/>
<Setter Property="Height"
Value="30"/>
<Setter Property="Padding"
Value="5,3"/>
<Setter Property="VerticalContentAlignment"
Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<ToggleButton x:Name="ToggleButton"
BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}"
Foreground="{TemplateBinding Foreground}"
IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
ClickMode="Press">
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="Border"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
Background="{TemplateBinding Background}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="20"/>
</Grid.ColumnDefinitions>
<ContentPresenter Grid.Column="0"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
HorizontalAlignment="Left"
Margin="4,0,0,0"
VerticalAlignment="Center"/>
<Path x:Name="Arrow"
Grid.Column="1"
Fill="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M0,0 L5,5 L10,0 Z"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="#444446"
TargetName="Border"/>
<Setter Property="BorderBrush"
Value="#007ACC"
TargetName="Border"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
<Popup x:Name="Popup"
AllowsTransparency="True"
Placement="Bottom"
IsOpen="{TemplateBinding IsDropDownOpen}"
PopupAnimation="Slide">
<Grid x:Name="DropDown"
SnapsToDevicePixels="True"
MinWidth="{TemplateBinding ActualWidth}"
MaxHeight="{TemplateBinding MaxDropDownHeight}">
<Border x:Name="DropDownBorder"
Background="#252526"
BorderBrush="#3E3E42"
BorderThickness="1"/>
<ScrollViewer SnapsToDevicePixels="True">
<ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained"/>
</ScrollViewer>
</Grid>
</Popup>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground"
Value="White"/>
<Setter Property="VerticalAlignment"
Value="Center"/>
</Style>
<Style TargetType="ListView">
<Setter Property="Background"
Value="#252526"/>
<Setter Property="BorderBrush"
Value="#3E3E42"/>
<Setter Property="BorderThickness"
Value="1"/>
<Setter Property="Padding"
Value="2"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility"
Value="Disabled"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility"
Value="Auto"/>
</Style>
<Style TargetType="GridViewColumnHeader">
<Setter Property="Background"
Value="#2D2D30"/>
<Setter Property="Foreground"
Value="#FFFFFF"/>
<Setter Property="BorderBrush"
Value="#3E3E42"/>
<Setter Property="BorderThickness"
Value="0,0,1,1"/>
<Setter Property="Padding"
Value="8,5"/>
<Setter Property="Height"
Value="32"/>
<Setter Property="HorizontalContentAlignment"
Value="Left"/>
<!-- Prevent column resizing -->
<Setter Property="IsEnabled"
Value="False"/>
<!-- Remove hover trigger to prevent any background change when mouse hovers -->
</Style>
<!-- Style for TextBlock within ListView to ensure text is white -->
<Style x:Key="ListViewTextBlockStyle"
TargetType="TextBlock"
BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="Foreground"
Value="White"/>
<Setter Property="FontWeight"
Value="Bold"/>
<Setter Property="VerticalAlignment"
Value="Center"/>
</Style>
<!-- Style for ComboBox items in ListView -->
<Style x:Key="ListViewComboBoxStyle"
TargetType="ComboBox"
BasedOn="{StaticResource {x:Type ComboBox}}">
<Setter Property="Background"
Value="#333337"/>
<Setter Property="Foreground"
Value="White"/>
<Setter Property="BorderThickness"
Value="1"/>
<Setter Property="VerticalContentAlignment"
Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<ToggleButton x:Name="ToggleButton"
BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}"
Foreground="{TemplateBinding Foreground}"
IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
ClickMode="Press">
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="Border"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
Background="{TemplateBinding Background}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="20"/>
</Grid.ColumnDefinitions>
<ContentPresenter Grid.Column="0"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
HorizontalAlignment="Left"
Margin="4,0,0,0"
VerticalAlignment="Center"/>
<Path x:Name="Arrow"
Grid.Column="1"
Fill="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M0,0 L5,5 L10,0 Z"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="BorderThickness"
Value="2"
TargetName="Border"/>
<Setter Property="BorderBrush"
Value="#66BCFF"
TargetName="Border"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
<ContentPresenter
Name="ContentSite"
IsHitTestVisible="False"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
Margin="8,3,30,3"
VerticalAlignment="Center"
HorizontalAlignment="Left"/>
<Popup x:Name="Popup"
AllowsTransparency="True"
Placement="Bottom"
IsOpen="{TemplateBinding IsDropDownOpen}"
PopupAnimation="Slide">
<Grid x:Name="DropDown"
SnapsToDevicePixels="True"
MinWidth="{TemplateBinding ActualWidth}"
MaxHeight="{TemplateBinding MaxDropDownHeight}">
<Border x:Name="DropDownBorder"
Background="#252526"
BorderBrush="#3E3E42"
BorderThickness="1"/>
<ScrollViewer SnapsToDevicePixels="True">
<ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained"/>
</ScrollViewer>
</Grid>
</Popup>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Style for ComboBox items -->
<Style x:Key="DarkComboBoxItem"
TargetType="ComboBoxItem">
<Setter Property="Background"
Value="#252526"/>
<Setter Property="Foreground"
Value="White"/>
<Setter Property="Padding"
Value="5,3"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border x:Name="Border"
Background="{TemplateBinding Background}"
BorderBrush="Transparent"
BorderThickness="1"
Padding="{TemplateBinding Padding}">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected"
Value="True">
<Setter Property="Background"
Value="#007ACC"
TargetName="Border"/>
</Trigger>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="BorderBrush"
Value="#66BCFF"
TargetName="Border"/>
<Setter Property="BorderThickness"
Value="1"
TargetName="Border"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid Margin="15">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Header with Status Indicators -->
<Grid Grid.Row="0"
Margin="0,0,0,15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock Text="BARS Client"
FontSize="24"
FontWeight="Bold"
Margin="0,0,0,10"
Foreground="White"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Left side: simulator status + simulator name -->
<StackPanel Grid.Column="0"
Grid.Row="0"
Orientation="Horizontal"
Margin="0,0,0,4">
<TextBlock Text="Sim Status:"
FontWeight="SemiBold"
Margin="0,0,5,0"/>
<Ellipse Width="10"
Height="10"
Margin="0,0,5,0"
VerticalAlignment="Center">
<Ellipse.Fill>
<SolidColorBrush Color="{Binding SimulatorStatusColor}"/>
</Ellipse.Fill>
</Ellipse>
<TextBlock Text="{Binding SimulatorConnectionText}"
Foreground="{Binding SimulatorStatusColor}"/>
</StackPanel>
<StackPanel Grid.Column="0"
Grid.Row="1"
Orientation="Horizontal">
<TextBlock Text="Simulator:"
FontWeight="SemiBold"
Margin="0,0,5,0"/>
<TextBlock Text="{Binding SimulatorName}"
FontWeight="Bold"/>
</StackPanel>
<!-- Right side: nearest airport + server status -->
<!-- Swapped: Server Status now on top row, Nearest Airport below -->
<StackPanel Grid.Column="1"
Grid.Row="0"
Orientation="Horizontal"
HorizontalAlignment="Right"
Margin="0,0,0,4">
<TextBlock Text="Server Status:"
FontWeight="SemiBold"
Margin="0,0,5,0"/>
<Ellipse Width="10"
Height="10"
Margin="0,0,5,0"
VerticalAlignment="Center">
<Ellipse.Fill>
<SolidColorBrush Color="{Binding ServerStatusColor}"/>
</Ellipse.Fill>
</Ellipse>
<TextBlock Text="{Binding ServerStatusText}"
Foreground="{Binding ServerStatusColor}"/>
</StackPanel>
<StackPanel Grid.Column="1"
Grid.Row="1"
Orientation="Horizontal"
HorizontalAlignment="Right">
<TextBlock Text="Nearest Airport:"
FontWeight="SemiBold"
Margin="0,0,5,0"/>
<TextBlock Text="{Binding ClosestAirport}"
FontWeight="Bold"/>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
<!-- API Token and Search in vertical layout -->
<StackPanel Grid.Row="1"
Margin="0,0,0,15">
<!-- API Token Entry masked with PasswordBox -->
<StackPanel Margin="0,0,0,10">
<TextBlock Text="API Token"
Margin="0,0,0,5"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<PasswordBox x:Name="ApiTokenPasswordBox"
local:Presentation.Behaviors.PasswordBoxAssistant.BindPassword="True"
local:Presentation.Behaviors.PasswordBoxAssistant.BoundPassword="{Binding ApiToken, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<TextBlock Text="Enter BARS API Token Here"
Margin="5,0,0,0"
VerticalAlignment="Center"
Foreground="#858585"
IsHitTestVisible="False"
Visibility="{Binding ApiToken, Converter={StaticResource NullOrEmptyToVisibilityConverter}}"/>
</Grid>
<Button Grid.Column="1"
Content="Save"
x:Name="SaveTokenButton"
Width="60"
Margin="5,0,0,0"
Command="{Binding SaveTokenCommand}"/>
</Grid>
</StackPanel>
<!-- Airport Search -->
<StackPanel>
<TextBlock Text="Search Airports"
Margin="0,0,0,5"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="SearchAirportsTextBox"
Grid.Column="0"
Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}">
<TextBox.Style>
<Style TargetType="TextBox"
BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<ScrollViewer x:Name="PART_ContentHost"
Focusable="false"/>
<TextBlock Text="Enter ICAO or scenery package to search"
Foreground="#858585"
Margin="5,0,0,0"
VerticalAlignment="Center"
Visibility="{Binding Path=Text.IsEmpty, RelativeSource={RelativeSource AncestorType=TextBox}, Converter={StaticResource BooleanToVisibilityConverter}}"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="BorderBrush"
Value="#007ACC"
TargetName="border"/>
</Trigger>
<Trigger Property="IsFocused"
Value="True">
<Setter Property="BorderBrush"
Value="#66BCFF"
TargetName="border"/>
<Setter Property="BorderThickness"
Value="2"
TargetName="border"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</TextBox.Style>
</TextBox>
<Button x:Name="SearchButton"
Grid.Column="1"
Content="Search"
Width="60"
Margin="5,0,0,0"
Command="{Binding SearchCommand}"/>
</Grid>
</StackPanel>
</StackPanel>
<!-- Airport List Header -->
<TextBlock Grid.Row="2"
Text="Airport List"
FontSize="16"
FontWeight="SemiBold"
Margin="0,0,0,5"/>
<!-- Custom Airports Display using ItemsControl instead of ListView -->
<Border Grid.Row="3"
BorderBrush="#3E3E42"
BorderThickness="1"
Background="#252526"
Margin="0,5">
<DockPanel>
<!-- Header -->
<Grid DockPanel.Dock="Top"
Background="#2D2D30">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="ICAO"
Foreground="White"
Padding="8,5"
FontWeight="SemiBold"/>
<TextBlock Grid.Column="1"
Text="Scenery Package"
Foreground="White"
Padding="5,5"
FontWeight="SemiBold"/>
</Grid>
<!-- Items -->
<ScrollViewer VerticalScrollBarVisibility="Hidden"
HorizontalScrollBarVisibility="Disabled">
<ItemsControl x:Name="AirportsItemsControl"
Margin="0"
ItemsSource="{Binding Airports}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderThickness="0,0,0,1"
BorderBrush="#3E3E42"
Background="Transparent">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="{Binding ICAO}"
Foreground="White"
FontWeight="Bold"
Padding="8,8,5,8"
VerticalAlignment="Center"/>
<Border Grid.Column="1"
Padding="5,5">
<ComboBox Width="440"
ItemsSource="{Binding SceneryPackages}"
SelectedItem="{Binding SelectedPackage, Mode=TwoWay}"
DisplayMemberPath="Name"
Style="{StaticResource ListViewComboBoxStyle}"
ItemContainerStyle="{StaticResource DarkComboBoxItem}"/>
</Border>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</DockPanel>
</Border>
<!-- Pagination Controls -->
<Grid Grid.Row="4"
Margin="0,10,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
x:Name="PreviousPageButton"
Content="Previous Page"
Width="120"
Height="24"
Command="{Binding PrevPageCommand}"/>
<TextBlock Grid.Column="1"
x:Name="PageInfoText"
Text="{Binding PageInfo}"
HorizontalAlignment="Center"/>
<Button Grid.Column="2"
x:Name="NextPageButton"
Content="Next Page"
Width="120"
Height="24"
Command="{Binding NextPageCommand}"/>
</Grid>
</Grid>
</Window>