-
Notifications
You must be signed in to change notification settings - Fork 821
Expand file tree
/
Copy pathAbstractPackagesPage.axaml
More file actions
768 lines (736 loc) · 52.2 KB
/
AbstractPackagesPage.axaml
File metadata and controls
768 lines (736 loc) · 52.2 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
<UserControl x:Class="UniGetUI.Avalonia.Views.Pages.AbstractPackagesPage"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:automation="clr-namespace:Avalonia.Automation;assembly=Avalonia.Controls"
xmlns:peers="clr-namespace:Avalonia.Automation.Peers;assembly=Avalonia.Controls"
xmlns:vm="using:UniGetUI.Avalonia.ViewModels.Pages"
xmlns:controls="using:UniGetUI.Avalonia.Views.Controls"
xmlns:pkg="using:UniGetUI.PackageEngine.PackageClasses"
xmlns:t="using:UniGetUI.Avalonia.MarkupExtensions"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:DataType="vm:PackagesPageViewModel"
Name="ABSTRACT_PAGE">
<UserControl.Styles>
<!-- Suppress per-cell focus highlight so the whole row appears selected -->
<Style Selector="DataGridCell:current /template/ Grid#FocusVisual">
<Setter Property="IsVisible" Value="False"/>
</Style>
<Style Selector="DataGridCell:current">
<Setter Property="BorderBrush" Value="Transparent"/>
</Style>
<Style Selector="DataGridColumnHeader">
<Setter Property="Background" Value="{DynamicResource SettingsCardBackground}"/>
</Style>
<Style Selector="Expander /template/ ToggleButton#ExpanderHeader">
<Setter Property="Background" Value="{DynamicResource SettingsCardBackground}"/>
</Style>
<!-- Toolbar buttons: flat, no background/border in normal state (WinUI AppBarButton style) -->
<Style Selector="#ToolbarRow Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style Selector="#ToolbarRow ToggleButton">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style Selector="#ToolbarRow ToggleButton:checked">
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}"/>
</Style>
<!-- Main action button: card background with border -->
<Style Selector="Button#MainToolbarButton">
<Setter Property="Background" Value="{DynamicResource SettingsCardBackground}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style Selector="Button#MainToolbarButtonDropdown">
<Setter Property="Background" Value="{DynamicResource SettingsCardBackground}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
</UserControl.Styles>
<Grid RowDefinitions="Auto,Auto,*,Auto" Margin="8,8,8,8">
<!-- ==================== HEADER ==================== -->
<Grid Name="MainHeader"
Grid.Row="0"
ColumnDefinitions="80,*"
ColumnSpacing="8"
Margin="0,0,0,8">
<controls:SvgIcon x:Name="HeaderIcon"
Grid.Column="0"
Width="40"
Height="40"
Margin="0,0,4,0"
automation:AutomationProperties.AccessibilityView="Raw"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Path="{Binding PageIconPath}"/>
<StackPanel Grid.Column="1" VerticalAlignment="Center" Spacing="0">
<TextBlock x:Name="MainTitle"
MaxHeight="60"
HorizontalAlignment="Left"
FontSize="24"
FontWeight="Bold"
TextWrapping="Wrap"
Text="{Binding PageTitle}"/>
<TextBlock x:Name="MainSubtitle"
MaxHeight="40"
HorizontalAlignment="Left"
FontSize="12"
FontWeight="Normal"
Opacity="0.6"
TextWrapping="Wrap"
Text="{Binding Subtitle}"/>
</StackPanel>
</Grid>
<!-- ==================== TOOLBAR ROW ==================== -->
<Grid Name="ToolbarRow"
Grid.Row="1"
ColumnDefinitions="Auto,Auto,*"
ColumnSpacing="4"
Margin="0">
<!-- Filters toggle — MinWidth tracks the filter pane so action buttons stay aligned with the package list -->
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="0,0,8,0"
MinWidth="{Binding FilterPaneColumnWidth}">
<ToggleButton x:Name="ToggleFiltersButton"
Height="36"
Padding="8,4"
CornerRadius="4"
automation:AutomationProperties.Name="{t:Translate Filters}"
IsChecked="{Binding IsFilterPaneOpen, Mode=TwoWay}">
<StackPanel Orientation="Horizontal" Spacing="8">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/Filter.svg" Width="16" Height="16" VerticalAlignment="Center"/>
<TextBlock Text="{t:Translate Filters}" FontSize="12" FontWeight="Medium" VerticalAlignment="Center"/>
</StackPanel>
</ToggleButton>
</StackPanel>
<!-- Main action button + dropdown -->
<StackPanel Grid.Column="1" Orientation="Horizontal">
<Button x:Name="MainToolbarButton"
Height="36"
Margin="-9,0,1,0"
CornerRadius="4,0,0,4">
<StackPanel Orientation="Horizontal" Spacing="4">
<controls:SvgIcon x:Name="MainToolbarButtonIcon"
Width="16" Height="16"
VerticalAlignment="Center"/>
<TextBlock x:Name="MainToolbarButtonText"
FontSize="12"
FontWeight="SemiBold"
VerticalAlignment="Center"/>
</StackPanel>
</Button>
<Button x:Name="MainToolbarButtonDropdown"
Width="30"
Height="36"
Padding="4"
automation:AutomationProperties.Name="{t:Translate More}"
CornerRadius="0,4,4,0">
<TextBlock Text="▾" FontSize="20" HorizontalAlignment="Center"
automation:AutomationProperties.AccessibilityView="Raw"/>
</Button>
</StackPanel>
<!-- Toolbar (AppBarButtons added by subclass) -->
<ItemsControl x:Name="ToolBar"
Grid.Column="2"
HorizontalAlignment="Left"
ItemsSource="{Binding ToolBarItems}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Spacing="4"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</Grid>
<!-- ==================== MAIN CONTENT (filter pane + package list) ==================== -->
<Grid x:Name="FilteringPanel"
Grid.Row="2"
ColumnDefinitions="220,4,*">
<!-- ===== FILTER PANE ===== -->
<ScrollViewer x:Name="SidePanel"
Grid.Column="0"
IsVisible="{Binding IsFilterPaneOpen}"
HorizontalScrollBarVisibility="Disabled"
Padding="0,8,4,0"
automation:AutomationProperties.AccessibilityView="Control"
automation:AutomationProperties.Name="{t:Translate Filters}"
automation:AutomationProperties.LandmarkType="{x:Static peers:AutomationLandmarkType.Search}"
Background="{DynamicResource AppWindowBackground}">
<StackPanel x:Name="SidePanelGrid" Spacing="8" Margin="0,0,0,8">
<!-- Sources expander -->
<Expander HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
IsExpanded="True"
CornerRadius="8"
Padding="4,4,4,8"
Background="{DynamicResource SettingsCardBackground}">
<Expander.Header>
<StackPanel Orientation="Horizontal" Spacing="8">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/Sources.svg" Width="16" Height="16" VerticalAlignment="Center"/>
<TextBlock Text="{t:Translate Sources}" FontWeight="SemiBold" VerticalAlignment="Center"/>
</StackPanel>
</Expander.Header>
<StackPanel Orientation="Vertical">
<TextBlock x:Name="SourcesPlaceholderText"
Text="{t:Translate Search for packages to start}"
MinHeight="60"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="15"
FontWeight="Bold"
Opacity="0.5"
TextWrapping="Wrap"
IsVisible="{Binding SourcesPlaceholderVisible}"/>
<Grid x:Name="SourcesTreeViewGrid"
IsVisible="{Binding SourcesTreeVisible}"
ColumnDefinitions="*,*"
RowDefinitions="Auto,Auto"
RowSpacing="4"
ColumnSpacing="4">
<Button x:Name="SelectAllSourcesButton"
Grid.Column="0"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
Command="{Binding SelectAllSources_CmdCommand}"
automation:AutomationProperties.Name="{t:Translate Select all}"
Padding="2"
Background="Transparent"
BorderThickness="0">
<TextBlock Text="{t:Translate Select all}" FontSize="12" FontWeight="SemiBold"/>
</Button>
<Button x:Name="ClearSourceSelectionButton"
Grid.Column="1"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
Command="{Binding ClearSourceSelection_CmdCommand}"
automation:AutomationProperties.Name="{t:Translate Clear selection}"
Padding="2"
Background="Transparent"
BorderThickness="0">
<TextBlock Text="{t:Translate Clear selection}" FontSize="12" FontWeight="SemiBold"/>
</Button>
<ItemsControl x:Name="SourcesTreeView"
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
HorizontalAlignment="Stretch"
ItemsSource="{Binding SourceNodes}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:SourceTreeNode">
<StackPanel>
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}"
Content="{Binding PackageName}"/>
<!-- Child sources, indented, shown when manager has custom sources -->
<ItemsControl ItemsSource="{Binding Children}"
Margin="20,0,0,0">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:SourceTreeNode">
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}"
Content="{Binding PackageName}"
FontSize="12"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</StackPanel>
</Expander>
<!-- Filter options expander -->
<Expander HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
IsExpanded="False"
CornerRadius="8"
Padding="16,8,16,8"
Background="{DynamicResource SettingsCardBackground}">
<Expander.Header>
<StackPanel Orientation="Horizontal" Spacing="8">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/Filter.svg" Width="16" Height="16" VerticalAlignment="Center"/>
<TextBlock Text="{t:Translate Filters}" FontWeight="SemiBold" VerticalAlignment="Center"/>
</StackPanel>
</Expander.Header>
<StackPanel HorizontalAlignment="Stretch" Orientation="Vertical" Spacing="0">
<CheckBox x:Name="InstantSearchCheckbox"
IsChecked="{Binding InstantSearch, Mode=TwoWay}"
automation:AutomationProperties.Name="{t:Translate Instant search}">
<TextBlock Text="{t:Translate Instant search}" TextWrapping="Wrap"/>
</CheckBox>
<CheckBox x:Name="UpperLowerCaseCheckbox"
IsChecked="{Binding UpperLowerCase, Mode=TwoWay}"
automation:AutomationProperties.Name="{t:Translate Distinguish between uppercase and lowercase}">
<TextBlock Text="{t:Translate Distinguish between uppercase and lowercase}" TextWrapping="Wrap"/>
</CheckBox>
<CheckBox x:Name="IgnoreSpecialCharsCheckbox"
IsChecked="{Binding IgnoreSpecialChars, Mode=TwoWay}"
automation:AutomationProperties.Name="{t:Translate Ignore special characters}">
<TextBlock Text="{t:Translate Ignore special characters}" TextWrapping="Wrap"/>
</CheckBox>
</StackPanel>
</Expander>
<!-- Search mode expander -->
<Expander HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
IsExpanded="True"
CornerRadius="8"
Padding="16,8,16,8"
Background="{DynamicResource SettingsCardBackground}">
<Expander.Header>
<StackPanel Orientation="Horizontal" Spacing="8">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/search.svg" Width="16" Height="16" VerticalAlignment="Center"/>
<TextBlock Text="{t:Translate Search mode}" FontWeight="SemiBold" VerticalAlignment="Center"/>
</StackPanel>
</Expander.Header>
<StackPanel HorizontalAlignment="Stretch" Orientation="Vertical" Spacing="0">
<RadioButton Height="30"
Margin="0,-2,0,-2"
IsChecked="{Binding SearchMode_Name, Mode=TwoWay}"
automation:AutomationProperties.Name="{t:Translate Package Name}">
<TextBlock Text="{t:Translate Package Name}" TextWrapping="Wrap"/>
</RadioButton>
<RadioButton Height="30"
Margin="0,-2,0,-2"
IsChecked="{Binding SearchMode_Id, Mode=TwoWay}"
automation:AutomationProperties.Name="{t:Translate Package ID}">
<TextBlock Text="{t:Translate Package ID}" TextWrapping="Wrap"/>
</RadioButton>
<RadioButton Height="30"
Margin="0,-2,0,-2"
IsChecked="{Binding SearchMode_Both, Mode=TwoWay}"
automation:AutomationProperties.Name="{t:Translate Both}">
<TextBlock Text="{t:Translate Both}" TextWrapping="Wrap"/>
</RadioButton>
<RadioButton Height="30"
Margin="0,-2,0,-2"
IsChecked="{Binding SearchMode_Exact, Mode=TwoWay}"
automation:AutomationProperties.Name="{t:Translate Exact match}">
<TextBlock Text="{t:Translate Exact match}" TextWrapping="Wrap"/>
</RadioButton>
<RadioButton Height="30"
Margin="0,-2,0,-2"
IsChecked="{Binding SearchMode_Similar, Mode=TwoWay}"
IsEnabled="{Binding SimilarSearchEnabled}"
automation:AutomationProperties.Name="{t:Translate Show similar packages}">
<TextBlock Text="{t:Translate Show similar packages}" TextWrapping="Wrap"/>
</RadioButton>
</StackPanel>
</Expander>
</StackPanel>
</ScrollViewer>
<!-- ===== DRAG SPLITTER ===== -->
<GridSplitter x:Name="FilterSplitter"
Grid.Column="1"
IsVisible="{Binding IsFilterPaneOpen}"
HorizontalAlignment="Stretch"
ResizeDirection="Columns"
Background="{DynamicResource AppWindowBackground}"/>
<!-- ===== OVERLAY BACKDROP (overlay mode only, dismisses pane on click) ===== -->
<Border x:Name="FilterOverlayBackdrop"
Grid.Column="0"
Grid.ColumnSpan="3"
ZIndex="9"
Background="#60000000"
IsVisible="False"
IsHitTestVisible="True"/>
<!-- ===== PACKAGE LIST ===== -->
<Grid x:Name="PackagesListGrid" Grid.Column="2" Margin="0">
<!-- Loading indicator -->
<ProgressBar x:Name="LoadingProgressBar"
IsIndeterminate="True"
IsVisible="{Binding IsLoading}"
automation:AutomationProperties.Name="{t:Translate Loading}"
Height="4"
VerticalAlignment="Top"
HorizontalAlignment="Stretch"
Margin="1,0,1,0"/>
<!-- Package list container -->
<Border Margin="0,6,0,6"
CornerRadius="8"
BorderThickness="1"
BorderBrush="{DynamicResource AppBorderBrush}"
Background="{DynamicResource SettingsCardBackground}">
<Grid RowDefinitions="Auto,*">
<!-- Header bar for grid/icons views (select-all) — hidden in list mode, which has its own DataGrid header -->
<Border Grid.Row="0"
IsVisible="{Binding !IsListViewMode}"
BorderBrush="{DynamicResource AppBorderBrush}"
BorderThickness="0,0,0,1"
Padding="10,0">
<CheckBox IsChecked="{Binding AllPackagesChecked, Mode=TwoWay}"
Content="{t:Translate Select all}"
Height="32"
VerticalAlignment="Center"/>
</Border>
<!-- Package list (list/grid/icons views) -->
<Panel Grid.Row="1">
<DataGrid x:Name="PackageList"
IsVisible="{Binding IsListViewMode}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ItemsSource="{Binding FilteredPackages}"
automation:AutomationProperties.AccessibilityView="Control"
automation:AutomationProperties.Name="{Binding PageTitle}"
automation:AutomationProperties.HelpText="{Binding Subtitle}"
AutoGenerateColumns="False"
CanUserReorderColumns="True"
CanUserResizeColumns="True"
CanUserSortColumns="True"
SelectionMode="Extended"
GridLinesVisibility="Horizontal">
<DataGrid.Columns>
<DataGridTemplateColumn Width="40">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate x:DataType="pkg:PackageWrapper">
<CheckBox IsChecked="{Binding IsChecked}"
automation:AutomationProperties.Name="{Binding Package.AutomationName}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="5,0,0,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Tag="Name" SortMemberPath="Package.Name"
Header="{Binding $parent[UserControl].((vm:PackagesPageViewModel)DataContext).NameHeaderText}"
Width="2*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate x:DataType="pkg:PackageWrapper">
<StackPanel Orientation="Horizontal" Spacing="6" VerticalAlignment="Center" Margin="4,0"
automation:AutomationProperties.Name="{Binding Package.AutomationName}"
automation:AutomationProperties.ItemType="{t:Translate Package}">
<Panel Width="16" Height="16" VerticalAlignment="Center">
<Image Source="{Binding IconBitmap}" Width="16" Height="16"
Stretch="Uniform" IsVisible="{Binding HasCustomIcon}"/>
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/package.svg"
Width="16" Height="16" IsVisible="{Binding !HasCustomIcon}"/>
<controls:SvgIcon Path="{Binding TagIconPath}"
Width="8" Height="8"
IsVisible="{Binding TagIconVisible}"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"/>
</Panel>
<TextBlock Text="{Binding Package.Name}" VerticalAlignment="Center"/>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Tag="Id" SortMemberPath="Package.Id"
Header="{Binding $parent[UserControl].((vm:PackagesPageViewModel)DataContext).IdHeaderText}"
Width="2*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate x:DataType="pkg:PackageWrapper">
<StackPanel Orientation="Horizontal" Spacing="6" VerticalAlignment="Center" Margin="4,0">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/id.svg"
Width="16" Height="16" VerticalAlignment="Center"/>
<TextBlock Text="{Binding Package.Id}" VerticalAlignment="Center"/>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Tag="Version" SortMemberPath="VersionComboString"
Header="{Binding $parent[UserControl].((vm:PackagesPageViewModel)DataContext).VersionHeaderText}"
Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate x:DataType="pkg:PackageWrapper">
<StackPanel Orientation="Horizontal" Spacing="6" VerticalAlignment="Center" Margin="4,0">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/version.svg"
Width="16" Height="16" VerticalAlignment="Center"/>
<TextBlock Text="{Binding VersionComboString}" VerticalAlignment="Center"/>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Tag="NewVersion" SortMemberPath="Package.NewVersionString"
Header="{Binding $parent[UserControl].((vm:PackagesPageViewModel)DataContext).NewVersionHeaderText}"
Width="*"
IsVisible="{Binding $parent[UserControl].((vm:PackagesPageViewModel)DataContext).NewVersionHeaderVisible}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate x:DataType="pkg:PackageWrapper">
<StackPanel Orientation="Horizontal" Spacing="6" VerticalAlignment="Center" Margin="4,0">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/download.svg"
Width="16" Height="16" VerticalAlignment="Center"
IsVisible="{Binding !InstallerHostChanged}"/>
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/warning_filled.svg"
Width="16" Height="16" VerticalAlignment="Center"
Foreground="#F59E0B"
IsVisible="{Binding InstallerHostChanged}"
ToolTip.Tip="{Binding InstallerHostChangeTooltip}"/>
<TextBlock Text="{Binding Package.NewVersionString}" VerticalAlignment="Center"/>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Tag="Source" SortMemberPath="Package.Source.AsString_DisplayName"
Header="{Binding $parent[UserControl].((vm:PackagesPageViewModel)DataContext).SourceHeaderText}"
Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate x:DataType="pkg:PackageWrapper">
<StackPanel Orientation="Horizontal" Spacing="6" VerticalAlignment="Center" Margin="4,0">
<controls:SvgIcon Path="{Binding SourceIconPath}"
Width="16" Height="16" VerticalAlignment="Center"/>
<TextBlock Text="{Binding Package.Source.AsString_DisplayName}" VerticalAlignment="Center"/>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<!-- Select-all checkbox overlaid on the first column header (list mode only) -->
<CheckBox IsChecked="{Binding AllPackagesChecked, Mode=TwoWay}"
IsVisible="{Binding IsListViewMode}"
Width="40" Height="32"
automation:AutomationProperties.Name="{t:Translate Select all}"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="8,0,0,0"
ZIndex="10"/>
<!-- ===== GRID VIEW ===== -->
<ScrollViewer IsVisible="{Binding IsGridViewMode}"
HorizontalScrollBarVisibility="Disabled">
<ItemsControl ItemsSource="{Binding FilteredPackages}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="pkg:PackageWrapper">
<Border CornerRadius="4" Margin="4" Width="275" Height="56"
automation:AutomationProperties.Name="{Binding Package.AutomationName}"
automation:AutomationProperties.ItemType="{t:Translate Package}"
Background="{DynamicResource AppBorderBrush}" Padding="4">
<Grid ColumnDefinitions="48,*,28" ColumnSpacing="4">
<Panel Grid.Column="0" Width="36" Height="36"
VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="{Binding IconBitmap}" Width="36" Height="36"
Stretch="Uniform" IsVisible="{Binding HasCustomIcon}"/>
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/package.svg"
Width="36" Height="36" IsVisible="{Binding !HasCustomIcon}"/>
<controls:SvgIcon Path="{Binding TagIconPath}"
Width="14" Height="14"
IsVisible="{Binding TagIconVisible}"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"/>
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/warning_filled.svg"
Width="14" Height="14"
Foreground="#F59E0B"
IsVisible="{Binding InstallerHostChanged}"
ToolTip.Tip="{Binding InstallerHostChangeTooltip}"
HorizontalAlignment="Right"
VerticalAlignment="Top"/>
</Panel>
<StackPanel Grid.Column="1" VerticalAlignment="Center" Spacing="1">
<TextBlock Text="{Binding Package.Name}"
FontWeight="SemiBold" FontSize="13"
TextTrimming="CharacterEllipsis"/>
<TextBlock Text="{Binding Package.Id}"
FontSize="11" Opacity="0.7"
TextTrimming="CharacterEllipsis"/>
<TextBlock Text="{Binding VersionComboString}"
FontSize="11" Opacity="0.5"
TextTrimming="CharacterEllipsis"/>
</StackPanel>
<!-- Col 2: checkbox (top) + overflow button (bottom) -->
<Panel Grid.Column="2">
<CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}"
automation:AutomationProperties.Name="{Binding Package.AutomationName}"
VerticalAlignment="Top"
HorizontalAlignment="Center"/>
<Button Click="CardOverflowButton_Click"
Width="22" Height="22" Padding="0"
VerticalAlignment="Bottom"
HorizontalAlignment="Center"
Background="Transparent" BorderThickness="0"
automation:AutomationProperties.Name="{t:Translate More options}">
<TextBlock Text="···" FontSize="16" VerticalAlignment="Center"/>
</Button>
</Panel>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<!-- ===== ICONS VIEW ===== -->
<ScrollViewer IsVisible="{Binding IsIconsViewMode}"
HorizontalScrollBarVisibility="Disabled">
<ItemsControl ItemsSource="{Binding FilteredPackages}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="pkg:PackageWrapper">
<Border CornerRadius="4" Margin="4" Width="128" Height="134"
automation:AutomationProperties.Name="{Binding Package.AutomationName}"
automation:AutomationProperties.ItemType="{t:Translate Package}"
Background="{DynamicResource AppBorderBrush}" Padding="4">
<Grid RowDefinitions="22,60,30,15">
<CheckBox Grid.Row="0"
IsChecked="{Binding IsChecked, Mode=TwoWay}"
automation:AutomationProperties.Name="{Binding Package.AutomationName}"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Padding="0" Margin="-4,0,0,0"/>
<Button Grid.Row="0"
Click="CardOverflowButton_Click"
Width="22" Height="22" Padding="0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="Transparent" BorderThickness="0"
automation:AutomationProperties.Name="{t:Translate More options}">
<TextBlock Text="···" FontSize="16" VerticalAlignment="Center"/>
</Button>
<Panel Grid.Row="1" Width="48" Height="48"
VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="{Binding IconBitmap}" Width="48" Height="48"
Stretch="Uniform" IsVisible="{Binding HasCustomIcon}"/>
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/package.svg"
Width="48" Height="48" IsVisible="{Binding !HasCustomIcon}"/>
<controls:SvgIcon Path="{Binding TagIconPath}"
Width="18" Height="18"
IsVisible="{Binding TagIconVisible}"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"/>
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/warning_filled.svg"
Width="18" Height="18"
Foreground="#F59E0B"
IsVisible="{Binding InstallerHostChanged}"
ToolTip.Tip="{Binding InstallerHostChangeTooltip}"
HorizontalAlignment="Right"
VerticalAlignment="Top"/>
</Panel>
<TextBlock Grid.Row="2"
Text="{Binding Package.Name}"
FontWeight="SemiBold" FontSize="12"
TextWrapping="Wrap"
HorizontalAlignment="Center"
TextAlignment="Center"
MaxLines="2"/>
<TextBlock Grid.Row="3"
Text="{Binding VersionComboString}"
FontSize="11" Opacity="0.5"
HorizontalAlignment="Center"
TextTrimming="CharacterEllipsis"/>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<!-- Background text (no packages / no matches) -->
<TextBlock x:Name="BackgroundText"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontSize="30"
FontWeight="Bold"
Opacity="0.5"
TextAlignment="Center"
TextWrapping="Wrap"
Text="{Binding BackgroundText}"
IsVisible="{Binding BackgroundTextVisible}"/>
</Panel>
</Grid>
</Border>
<!-- Mega query block (for Discover page) -->
<Grid x:Name="MegaQueryBlockGrid"
IsVisible="{Binding MegaQueryVisible}"
RowDefinitions="*,64,*"
ColumnDefinitions="*,8*,64,*">
<TextBox x:Name="MegaQueryBlock"
Grid.Row="1"
Grid.Column="1"
Padding="16,0,10,0"
VerticalContentAlignment="Center"
CornerRadius="8,0,0,8"
FontSize="40"
PlaceholderText="{t:Translate Search for packages}"
Background="{DynamicResource AppWindowBackground}"
automation:AutomationProperties.Name="{t:Translate Search for packages}"
Text="{Binding MegaQueryText, Mode=TwoWay}"
KeyDown="MegaQueryBlock_KeyDown"/>
<Button x:Name="MegaFindButton"
Grid.Row="1"
Grid.Column="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
CornerRadius="0,8,8,0"
automation:AutomationProperties.Name="{t:Translate Search for packages}"
Command="{Binding SubmitSearch}">
<controls:SvgIcon Path="avares://UniGetUI.Avalonia/Assets/Symbols/search.svg" Width="40" Height="40"/>
</Button>
</Grid>
</Grid>
</Grid>
<!-- ==================== FOOTER STATUS BAR ==================== -->
<Border Grid.Row="3" Margin="0,4,0,-8" VerticalAlignment="Center">
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
<!-- Order by -->
<StackPanel x:Name="OrderByContainer"
Orientation="Horizontal"
Spacing="4"
VerticalAlignment="Center">
<TextBlock x:Name="OrderByLabel" Text="{t:Translate Order by:}" FontSize="13" VerticalAlignment="Center"/>
<Button x:Name="OrderByButton"
Padding="10,6"
CornerRadius="4"
Background="Transparent"
BorderThickness="1"
BorderBrush="{DynamicResource AppBorderBrush}"
automation:AutomationProperties.LabeledBy="{Binding #OrderByLabel}">
<StackPanel Orientation="Horizontal" Spacing="6">
<TextBlock Text="{Binding SortFieldName}" VerticalAlignment="Center" FontSize="13"/>
<TextBlock Text="▾" VerticalAlignment="Center" FontSize="19" Opacity="0.7"
automation:AutomationProperties.AccessibilityView="Raw"/>
</StackPanel>
<Button.Flyout>
<MenuFlyout Placement="TopEdgeAlignedRight">
<MenuItem x:Name="OrderByName_Menu" Header="{t:Translate Name}" Command="{Binding SortByNameCommand}"/>
<MenuItem x:Name="OrderById_Menu" Header="{t:Translate Id}" Command="{Binding SortByIdCommand}"/>
<MenuItem x:Name="OrderByVersion_Menu" Header="{t:Translate Version}" Command="{Binding SortByVersionCommand}"/>
<MenuItem x:Name="OrderByNewVersion_Menu" Header="{t:Translate New version}" Command="{Binding SortByNewVersionCommand}"/>
<MenuItem x:Name="OrderBySource_Menu" Header="{t:Translate Source}" Command="{Binding SortBySourceCommand}"/>
<Separator/>
<MenuItem x:Name="OrderByAscending_Menu" Header="{t:Translate Ascendant}" Command="{Binding SetSortAscendingCommand}"/>
<MenuItem x:Name="OrderByDescending_Menu" Header="{t:Translate Descendant}" Command="{Binding SetSortDescendingCommand}"/>
</MenuFlyout>
</Button.Flyout>
</Button>
</StackPanel>
<!-- View mode selector -->
<StackPanel x:Name="ViewModeContainer"
Orientation="Horizontal"
Spacing="4"
VerticalAlignment="Center"
automation:AutomationProperties.Name="{t:Translate View modes}">
<ListBox x:Name="ViewModeSelector"
SelectionMode="Single"
SelectedIndex="{Binding ViewModeIndex, Mode=TwoWay}"
Background="Transparent"
BorderThickness="1"
BorderBrush="{DynamicResource AppBorderBrush}"
CornerRadius="4"
Padding="0">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBoxItem x:Name="Selector_List" Padding="10,6" ToolTip.Tip="List"
automation:AutomationProperties.Name="List">
<TextBlock Text="☰" FontSize="19" automation:AutomationProperties.AccessibilityView="Raw"/>
</ListBoxItem>
<ListBoxItem x:Name="Selector_Grid" Padding="10,6" ToolTip.Tip="Grid"
automation:AutomationProperties.Name="Grid">
<TextBlock Text="⊞" FontSize="19" automation:AutomationProperties.AccessibilityView="Raw"/>
</ListBoxItem>
<ListBoxItem x:Name="Selector_Icons" Padding="10,6" ToolTip.Tip="Icons"
automation:AutomationProperties.Name="Icons">
<TextBlock Text="⊟" FontSize="19" automation:AutomationProperties.AccessibilityView="Raw"/>
</ListBoxItem>
</ListBox>
</StackPanel>
</StackPanel>
</Border>
</Grid>
</UserControl>