-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWelcomeControl.xaml
More file actions
227 lines (219 loc) · 12.8 KB
/
Copy pathWelcomeControl.xaml
File metadata and controls
227 lines (219 loc) · 12.8 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
<UserControl x:Class="PkgInspector.WelcomeControl"
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"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800"
Background="{DynamicResource BackgroundBrush}"
AllowDrop="True"
Drop="UserControl_Drop"
DragOver="UserControl_DragOver">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="350"/>
</Grid.ColumnDefinitions>
<!-- Left Panel: App Info and Actions -->
<Border Grid.Column="0" Background="{DynamicResource SurfaceBrush}"
BorderBrush="{DynamicResource BorderBrush}"
BorderThickness="0,0,1,0"
Padding="40">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- App Icon and Title -->
<StackPanel Grid.Row="0" HorizontalAlignment="Center" Margin="0,40,0,0">
<!-- App icon from PNG -->
<Image Source="/Resources/app-icon.png"
Width="128" Height="128"
Margin="0,0,0,16"
RenderOptions.BitmapScalingMode="HighQuality">
<Image.Effect>
<DropShadowEffect ShadowDepth="0" Opacity="0"/>
</Image.Effect>
</Image>
<TextBlock Text="Package Inspector"
FontSize="28"
FontWeight="SemiBold"
Foreground="{DynamicResource TextPrimaryBrush}"
HorizontalAlignment="Center"
Margin="0,0,0,4"/>
<TextBlock Text="{Binding AppVersion, StringFormat='Version {0}'}"
FontSize="14"
Foreground="{DynamicResource TextSecondaryBrush}"
HorizontalAlignment="Center"/>
</StackPanel>
<!-- Action Buttons -->
<StackPanel Grid.Row="1" VerticalAlignment="Center" MaxWidth="400">
<!-- Choose Package Button -->
<Button Click="ChoosePackage_Click"
Background="{DynamicResource SurfaceBrush}"
BorderBrush="{DynamicResource BorderBrush}"
BorderThickness="1"
Padding="20"
Margin="0,0,0,16"
HorizontalContentAlignment="Left"
Cursor="Hand">
<Button.Style>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="8"
Padding="{TemplateBinding Padding}">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource HoverBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Button.Style>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="0"
Source="/Resources/package-icon.png"
Width="48" Height="48"
Margin="0,0,16,0"
RenderOptions.BitmapScalingMode="HighQuality">
<Image.Effect>
<DropShadowEffect ShadowDepth="0" Opacity="0"/>
</Image.Effect>
</Image>
<StackPanel Grid.Column="1" VerticalAlignment="Center">
<TextBlock Text="Choose a Windows Package to Inspect"
FontSize="15"
FontWeight="SemiBold"
Foreground="{DynamicResource TextPrimaryBrush}"
Margin="0,0,0,4"/>
<TextBlock Text="Find the package you want to inspect at right, and double-click to open it."
FontSize="12"
Foreground="{DynamicResource TextSecondaryBrush}"
TextWrapping="Wrap"/>
</StackPanel>
</Grid>
</Button>
<!-- Drag and Drop Hint -->
<Border Background="{DynamicResource SurfaceBrush}"
BorderBrush="{DynamicResource PrimaryBrush}"
BorderThickness="2"
CornerRadius="8"
Padding="16"
Margin="0,8,0,0">
<StackPanel>
<TextBlock Text="💡 Tip: Drag and Drop"
FontSize="14"
FontWeight="SemiBold"
Foreground="{DynamicResource PrimaryBrush}"
Margin="0,0,0,4"/>
<TextBlock Text="You can drag .msi or .nupkg files from anywhere and drop them into this window."
FontSize="12"
Foreground="{DynamicResource TextPrimaryBrush}"
TextWrapping="Wrap"/>
</StackPanel>
</Border>
</StackPanel>
<!-- Footer Info -->
<StackPanel Grid.Row="2" HorizontalAlignment="Center" Margin="0,0,0,20">
<TextBlock Text="A package inspector for Windows"
FontSize="12"
Foreground="{DynamicResource TextSecondaryBrush}"
HorizontalAlignment="Center"/>
<TextBlock FontSize="12"
Foreground="{DynamicResource TextSecondaryBrush}"
HorizontalAlignment="Center"
Margin="0,4,0,0">
<Run Text="Compatible with .msi and .nupkg files"/>
</TextBlock>
</StackPanel>
</Grid>
</Border>
<!-- Right Panel: Recent Packages -->
<Border Grid.Column="1" Background="{DynamicResource BackgroundBrush}" Padding="20">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Recent Packages Header -->
<TextBlock Grid.Row="0"
Text="Recent Packages"
FontSize="18"
FontWeight="SemiBold"
Foreground="{DynamicResource TextPrimaryBrush}"
Margin="0,0,0,16"/>
<!-- Recent Packages List -->
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<ItemsControl x:Name="RecentPackagesList">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Click="RecentPackage_Click"
Tag="{Binding FilePath}"
Background="Transparent"
BorderBrush="{DynamicResource BorderBrush}"
BorderThickness="0,0,0,1"
Padding="12"
Margin="0,0,0,0"
HorizontalContentAlignment="Left"
Cursor="Hand">
<Button.Style>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource HoverBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Button.Style>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock Text="{Binding FileName}"
FontSize="13"
FontWeight="SemiBold"
Foreground="{DynamicResource TextPrimaryBrush}"
TextTrimming="CharacterEllipsis"/>
<TextBlock Text="{Binding FolderPath}"
FontSize="11"
Foreground="{DynamicResource TextSecondaryBrush}"
TextTrimming="CharacterEllipsis"
Margin="0,2,0,0"/>
</StackPanel>
</Grid>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</Border>
</Grid>
</UserControl>