-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
162 lines (143 loc) · 9.52 KB
/
MainWindow.xaml
File metadata and controls
162 lines (143 loc) · 9.52 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
<Window x:Class="AsaModCleaner.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:AsaModCleaner"
xmlns:converters="clr-namespace:AsaModCleaner.Converters"
mc:Ignorable="d"
Closing="Window_Closing"
Title="ASA Mod Cleaner" Height="600" Width="800" WindowStyle="ThreeDBorderWindow" Icon="Assets/asa_mod_cleaner.ico">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- Link ScrollBar and ListViewItem Styles -->
<ResourceDictionary Source="/Styles/ScrollBarStyles.xaml"/>
<ResourceDictionary Source="/Styles/ListViewItemStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- Inline Converters -->
<converters:CategoryNameConverter x:Key="CategoryNameConverter"/>
<converters:PremiumToTextConverter x:Key="PremiumToTextConverter"/>
<!-- CollectionViewSource for Sorting -->
<CollectionViewSource x:Key="ModsCollectionView" Source="{Binding InstalledMods}"/>
</ResourceDictionary>
</Window.Resources>
<Window.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="WhiteSmoke"/>
<GradientStop Color="#FF8E8E8E" Offset="1"/>
<GradientStop Color="#FFE3E2E2" Offset="0.513"/>
</LinearGradientBrush>
</Window.Background>
<Grid Margin="0,0,0,-6">
<!-- Header with Logo -->
<Border Height="100" VerticalAlignment="Top" Background="#333333" CornerRadius="0,0,10,10">
<Border.Effect>
<DropShadowEffect/>
</Border.Effect>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Image Source="pack://application:,,,/Assets/asa_mod_cleaner.png" Height="64" Margin="10"/>
<TextBlock Text="ASA Mod Cleaner" Foreground="WhiteSmoke" FontSize="36" FontWeight="Bold" VerticalAlignment="Center" />
</StackPanel>
</Border>
<!-- Mod List Section -->
<Border Margin="20,120,20,80" CornerRadius="10" Background="#2E2E2E">
<Border.Effect>
<DropShadowEffect/>
</Border.Effect>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <!-- Header and buttons -->
<RowDefinition Height="Auto"/> <!-- Select All and Refresh buttons -->
<RowDefinition Height="*"/> <!-- ListView that should take remaining space -->
</Grid.RowDefinitions>
<!-- Installed Mods Header -->
<TextBlock Text="Installed Mods" FontSize="20" Foreground="WhiteSmoke" Margin="10" Grid.Row="0"/>
<!-- Select All and Refresh Buttons -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Row="1" Margin="10,0,0,10">
<Button x:Name="SelectAllButton" Content="Select All" Width="70" Height="22" Background="LightBlue" Foreground="Black" FontWeight="Bold" Click="SelectAllButton_Click" Margin="0,0,10,0"/>
<Button x:Name="RefreshButton" Content="Refresh" Width="70" Height="22" Background="Turquoise" BorderThickness="0" Foreground="Black" FontWeight="Bold" Click="RefreshButton_Click"/>
<!-- Sort Dropdown -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="Sort By:" Margin="20,0,5,0" Foreground="WhiteSmoke" VerticalAlignment="Center" FontSize="14" />
<ComboBox x:Name="SortCriteriaDropdown" Width="100" Height="25" Background="#2E2E2E" Foreground="Black" FontSize="14" SelectionChanged="SortCriteriaDropdown_SelectionChanged">
<ComboBoxItem Content="Install Date" Tag="InstallDate" IsSelected="True"/>
<ComboBoxItem Content="Name" Tag="Name"/>
<ComboBoxItem Content="Author" Tag="Author"/>
<ComboBoxItem Content="Free Mods" Tag="Free"/>
<ComboBoxItem Content="Premium Mods" Tag="Premium"/>
</ComboBox>
</StackPanel>
<!-- Sort Direction Dropdown -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="Direction:" Margin="10,0,5,0" Foreground="WhiteSmoke" VerticalAlignment="Center" FontSize="14" />
<ComboBox x:Name="SortDirectionDropdown" Width="105" Height="25" Background="#2E2E2E" Foreground="Black" FontSize="14" SelectionChanged="SortDirectionDropdown_SelectionChanged">
<ComboBoxItem Content="Ascending ↑" Tag="Ascending" IsSelected="True"/>
<ComboBoxItem Content="Descending ↓" Tag="Descending"/>
</ComboBox>
</StackPanel>
</StackPanel>
<!-- Mod List -->
<ListView Grid.Row="2" x:Name="ModList" ItemsSource="{Binding Source={StaticResource ModsCollectionView}}" Margin="10" Background="#3E3E3E">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical" Margin="5" Background="#3E3E3E">
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
<!-- Checkbox -->
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center" Margin="0,0,10,0"/>
<!-- Mod Name -->
<TextBlock Text="{Binding Details.Name}"
FontWeight="SemiBold" FontSize="14"
Foreground="White" TextWrapping="Wrap"/>
</StackPanel>
<!-- Mod Type (Category Name) -->
<TextBlock Text="Mod Type: " FontWeight="Light" FontSize="12" Foreground="LightGray" Margin="25,0,0,0">
<TextBlock.Inlines>
<Run Text="{Binding Details.Categories, Converter={StaticResource CategoryNameConverter}}"
Foreground="LightGreen" />
</TextBlock.Inlines>
</TextBlock>
<!-- Author -->
<TextBlock Text="Author: " FontWeight="Light" FontSize="12"
Foreground="LightGray" TextWrapping="Wrap" Margin="25,0,0,0">
<TextBlock.Inlines>
<Run Text="{Binding Details.Authors[0].Name, Mode=OneWay}" Foreground="Khaki"/>
</TextBlock.Inlines>
</TextBlock>
<!-- Installed Date -->
<TextBlock Text="Installed On: " FontWeight="Light" FontSize="12"
Foreground="LightGray" TextWrapping="Wrap" Margin="25,0,0,0">
<TextBlock.Inlines>
<Run Text="{Binding DateInstalledLocal, Mode=OneWay}" Foreground="LightBlue"/>
</TextBlock.Inlines>
</TextBlock>
<!-- Premium Indicator -->
<TextBlock FontStyle="Italic" FontSize="12" Foreground="Gold" Margin="25,0,0,0">
<TextBlock.Inlines>
<Run Text="{Binding Details.PremiumDetails.IsPremium, Converter={StaticResource PremiumToTextConverter}}" />
</TextBlock.Inlines>
</TextBlock>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Border>
<!-- Progress Bar -->
<ProgressBar x:Name="CleaningProgressBar" Height="20" Margin="20,0,20,80" VerticalAlignment="Bottom" Visibility="Collapsed"/>
<!-- Clean Button -->
<Button x:Name="CleanButton" Content="Clean" Width="150" Height="50" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,20,16"
Background="LimeGreen" BorderThickness="0" Foreground="Black" FontWeight="Bold" FontSize="20" Click="CleanButton_Click">
<Button.Effect>
<DropShadowEffect/>
</Button.Effect>
</Button>
<!-- Status Feedback Label -->
<TextBlock x:Name="StatusLabel" Text="" FontSize="16" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,30" FontWeight="Bold">
<TextBlock.Effect>
<DropShadowEffect/>
</TextBlock.Effect>
</TextBlock>
</Grid>
</Window>