Skip to content

Commit 37268db

Browse files
committed
2 parents 8988a81 + 0479c34 commit 37268db

File tree

4 files changed

+260
-75
lines changed

4 files changed

+260
-75
lines changed
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
<Application x:Class="GeneralUpdate.Packet.App"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:local="clr-namespace:GeneralUpdate.Packet"
5-
StartupUri="MainWindow.xaml">
1+
<Application
2+
x:Class="GeneralUpdate.Packet.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:local="clr-namespace:GeneralUpdate.Packet"
6+
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
7+
StartupUri="MainWindow.xaml">
68
<Application.Resources>
7-
9+
<ResourceDictionary>
10+
<ResourceDictionary.MergedDictionaries>
11+
<ui:ThemesDictionary Theme="Light" />
12+
<ui:ControlsDictionary />
13+
</ResourceDictionary.MergedDictionaries>
14+
</ResourceDictionary>
815
</Application.Resources>
916
</Application>

src/WPF/GeneralUpdate.Packet/GeneralUpdate.Packet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
1818
<PackageReference Include="GeneralUpdate.Differential" Version="1.4.3" />
1919
<PackageReference Include="GeneralUpdate.Zip" Version="2.3.2" />
20-
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
2120
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
2221
<PackageReference Include="WindowsAPICodePack" Version="7.0.4" />
22+
<PackageReference Include="WPF-UI" Version="3.0.4" />
2323
</ItemGroup>
2424

2525
<ItemGroup>

src/WPF/GeneralUpdate.Packet/MainWindow.xaml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,37 @@
1-
<Window x:Class="GeneralUpdate.Packet.MainWindow"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6-
xmlns:local="clr-namespace:GeneralUpdate.Packet"
7-
mc:Ignorable="d"
8-
Title="GeneralUpdate.Packet" Height="640" Width="900">
1+
<Window
2+
x:Class="GeneralUpdate.Packet.MainWindow"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:GeneralUpdate.Packet"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
9+
Title="GeneralUpdate.Packet"
10+
Width="900"
11+
Height="660"
12+
mc:Ignorable="d">
913
<Grid>
1014
<Grid.RowDefinitions>
11-
<RowDefinition Height="100"></RowDefinition>
12-
<RowDefinition></RowDefinition>
15+
<RowDefinition Height="100" />
16+
<RowDefinition />
1317
</Grid.RowDefinitions>
14-
<Image Source=".\Resource\GeneralUpdate_h.png"></Image>
15-
<TabControl Grid.Row="1" ItemsSource="{Binding Modules}" SelectedItem="{Binding CurrentModule}" TabStripPlacement="Left">
18+
<Image Source=".\Resource\GeneralUpdate_h.png" />
19+
<TabControl
20+
Grid.Row="1"
21+
ItemsSource="{Binding Modules}"
22+
SelectedItem="{Binding CurrentModule}"
23+
TabStripPlacement="Bottom">
1624
<TabControl.ItemTemplate>
1725
<DataTemplate>
1826
<TextBlock Text="{Binding Name}" />
1927
</DataTemplate>
2028
</TabControl.ItemTemplate>
2129
<TabControl.ContentTemplate>
2230
<DataTemplate>
23-
<ContentPresenter Width="Auto" Height="Auto" Content="{Binding View}" />
31+
<ContentPresenter
32+
Width="Auto"
33+
Height="Auto"
34+
Content="{Binding View}" />
2435
</DataTemplate>
2536
</TabControl.ContentTemplate>
2637
</TabControl>
Lines changed: 222 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
<UserControl x:Class="GeneralUpdate.Packet.Views.PacketView"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:local="clr-namespace:GeneralUpdate.Packet.Views"
7-
mc:Ignorable="d"
8-
d:DesignHeight="490" d:DesignWidth="800">
1+
<UserControl
2+
x:Class="GeneralUpdate.Packet.Views.PacketView"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:GeneralUpdate.Packet.Views"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
9+
d:DesignHeight="500"
10+
d:DesignWidth="800"
11+
mc:Ignorable="d">
12+
913
<Grid>
1014
<Grid.RowDefinitions>
1115
<RowDefinition />
@@ -24,65 +28,228 @@
2428
<RowDefinition />
2529
</Grid.RowDefinitions>
2630
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
27-
<Image Width="100" Height="100" Source="generalupdate_img.png" />
31+
<Image
32+
Width="100"
33+
Height="100"
34+
Source="generalupdate_img.png" />
2835
</StackPanel>
29-
<StackPanel Grid.Row="1" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
30-
<TextBlock VerticalAlignment="Center" Text="Source path :" />
31-
<TextBox Width="400" Height="30" Margin="3,0,3,0" Text="{Binding SourcePath}" VerticalContentAlignment="Center" />
32-
<Button Width="110" Height="30" Content="Pick folder" Command="{Binding SelectFolderCommand}" CommandParameter="Source" />
33-
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center" />
36+
<StackPanel
37+
Grid.Row="1"
38+
Height="40"
39+
HorizontalAlignment="Center"
40+
Orientation="Horizontal">
41+
<TextBlock VerticalAlignment="Center" Text="Source path :" />
42+
<TextBox
43+
Width="400"
44+
Height="35"
45+
Margin="3,0,3,0"
46+
VerticalContentAlignment="Center"
47+
Text="{Binding SourcePath}" />
48+
<Button
49+
Width="110"
50+
Height="35"
51+
Command="{Binding SelectFolderCommand}"
52+
CommandParameter="Source"
53+
Content="Pick folder" />
54+
<TextBlock
55+
VerticalAlignment="Center"
56+
Foreground="Red"
57+
Text="*" />
3458
</StackPanel>
35-
<StackPanel Grid.Row="2" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
36-
<TextBlock VerticalAlignment="Center" Text="Target path :" />
37-
<TextBox Width="400" Height="30" Margin="5,0,3,0" Text="{Binding TargetPath}" VerticalContentAlignment="Center" />
38-
<Button Width="110" Height="30" Content="Pick folder" Command="{Binding SelectFolderCommand}" CommandParameter="Target" />
39-
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center" />
59+
<StackPanel
60+
Grid.Row="2"
61+
Height="40"
62+
HorizontalAlignment="Center"
63+
Orientation="Horizontal">
64+
<TextBlock VerticalAlignment="Center" Text="Target path :" />
65+
<TextBox
66+
Width="400"
67+
Height="35"
68+
Margin="5,0,3,0"
69+
VerticalContentAlignment="Center"
70+
Text="{Binding TargetPath}" />
71+
<Button
72+
Width="110"
73+
Height="35"
74+
Command="{Binding SelectFolderCommand}"
75+
CommandParameter="Target"
76+
Content="Pick folder" />
77+
<TextBlock
78+
VerticalAlignment="Center"
79+
Foreground="Red"
80+
Text="*" />
4081
</StackPanel>
41-
<StackPanel Grid.Row="3" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
42-
<TextBlock VerticalAlignment="Center" Text="Patch path :" />
43-
<TextBox Width="400" Height="30" Margin="9,0,3,0" Text="{Binding PatchPath}" VerticalContentAlignment="Center" />
44-
<Button Width="110" Height="30" Content="Pick folder" Command="{Binding SelectFolderCommand}" CommandParameter="Patch" />
45-
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center" />
82+
<StackPanel
83+
Grid.Row="3"
84+
Height="40"
85+
HorizontalAlignment="Center"
86+
Orientation="Horizontal">
87+
<TextBlock VerticalAlignment="Center" Text="Patch path :" />
88+
<TextBox
89+
Width="400"
90+
Height="35"
91+
Margin="9,0,3,0"
92+
VerticalContentAlignment="Center"
93+
Text="{Binding PatchPath}" />
94+
<Button
95+
Width="110"
96+
Height="35"
97+
Command="{Binding SelectFolderCommand}"
98+
CommandParameter="Patch"
99+
Content="Pick folder" />
100+
<TextBlock
101+
VerticalAlignment="Center"
102+
Foreground="Red"
103+
Text="*" />
46104
</StackPanel>
47-
<StackPanel Margin="0,0,120,0" Grid.Row="4" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
48-
<TextBlock VerticalAlignment="Center" Text="Packet name :" />
49-
<TextBox Width="400" Height="30" Margin="9,0,3,0" Text="{Binding PacketName , Mode=TwoWay}" VerticalContentAlignment="Center" />
50-
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center" />
105+
<StackPanel
106+
Grid.Row="4"
107+
Height="40"
108+
Margin="0,0,120,0"
109+
HorizontalAlignment="Center"
110+
Orientation="Horizontal">
111+
<TextBlock VerticalAlignment="Center" Text="Packet name :" />
112+
<TextBox
113+
Width="400"
114+
Height="35"
115+
Margin="9,0,3,0"
116+
VerticalContentAlignment="Center"
117+
Text="{Binding PacketName, Mode=TwoWay}" />
118+
<TextBlock
119+
VerticalAlignment="Center"
120+
Foreground="Red"
121+
Text="*" />
51122
</StackPanel>
52-
<StackPanel Margin="0,0,85,0" Grid.Row="5" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
53-
<TextBlock VerticalAlignment="Center" Text="Format :" />
54-
<ComboBox Width="400" Height="30" Margin="9,0,3,0" ItemsSource="{Binding Formats}" SelectedItem="{Binding CurrentFormat}" VerticalContentAlignment="Center" />
55-
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center" />
123+
<StackPanel
124+
Grid.Row="5"
125+
Height="40"
126+
Margin="0,0,85,0"
127+
HorizontalAlignment="Center"
128+
Orientation="Horizontal">
129+
<TextBlock VerticalAlignment="Center" Text="Format :" />
130+
<ComboBox
131+
Width="400"
132+
Height="35"
133+
Margin="9,0,3,0"
134+
VerticalContentAlignment="Center"
135+
ItemsSource="{Binding Formats}"
136+
SelectedItem="{Binding CurrentFormat}" />
137+
<TextBlock
138+
VerticalAlignment="Center"
139+
Foreground="Red"
140+
Text="*" />
56141
</StackPanel>
57-
<StackPanel Margin="0,0,100,0" Grid.Row="6" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
58-
<TextBlock VerticalAlignment="Center" Text="Encoding :" />
59-
<ComboBox Width="400" Height="30" Margin="9,0,3,0" SelectedIndex="0" ItemsSource="{Binding Encodings}" SelectedItem="{Binding CurrentEncoding}" VerticalContentAlignment="Center" />
60-
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center" />
142+
<StackPanel
143+
Grid.Row="6"
144+
Height="40"
145+
Margin="0,0,100,0"
146+
HorizontalAlignment="Center"
147+
Orientation="Horizontal">
148+
<TextBlock VerticalAlignment="Center" Text="Encoding :" />
149+
<ComboBox
150+
Width="400"
151+
Height="35"
152+
Margin="9,0,3,0"
153+
VerticalContentAlignment="Center"
154+
ItemsSource="{Binding Encodings}"
155+
SelectedIndex="0"
156+
SelectedItem="{Binding CurrentEncoding}" />
157+
<TextBlock
158+
VerticalAlignment="Center"
159+
Foreground="Red"
160+
Text="*" />
61161
</StackPanel>
62-
<StackPanel Margin="0,0,135,0" Grid.Row="7" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
63-
<TextBlock VerticalAlignment="Center" Text="Client app key :" />
64-
<TextBox Width="400" Height="30" Margin="9,0,3,0" Text="{Binding CurrentClientAppKey}" VerticalContentAlignment="Center" />
162+
<StackPanel
163+
Grid.Row="7"
164+
Height="40"
165+
Margin="0,0,135,0"
166+
HorizontalAlignment="Center"
167+
Orientation="Horizontal">
168+
<TextBlock VerticalAlignment="Center" Text="Client app key :" />
169+
<TextBox
170+
Width="400"
171+
Height="35"
172+
Margin="9,0,3,0"
173+
VerticalContentAlignment="Center"
174+
Text="{Binding CurrentClientAppKey}" />
65175
</StackPanel>
66-
<StackPanel Margin="0,0,115,0" Grid.Row="8" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
67-
<TextBlock VerticalAlignment="Center" Text="Client type :" />
68-
<ComboBox Width="400" Height="32" Margin="9,0,3,0" ItemsSource="{Binding AppTypes}" SelectedItem="{Binding CurrentAppType}" VerticalContentAlignment="Center" />
176+
<StackPanel
177+
Grid.Row="8"
178+
Height="40"
179+
Margin="0,0,115,0"
180+
HorizontalAlignment="Center"
181+
Orientation="Horizontal">
182+
<TextBlock VerticalAlignment="Center" Text="Client type :" />
183+
<ComboBox
184+
Width="400"
185+
Height="35"
186+
Margin="9,0,3,0"
187+
VerticalContentAlignment="Center"
188+
ItemsSource="{Binding AppTypes}"
189+
SelectedItem="{Binding CurrentAppType}" />
69190
</StackPanel>
70-
<StackPanel Margin="0,5,110,5" Grid.Row="9" Orientation="Horizontal" HorizontalAlignment="Center">
71-
<TextBlock VerticalAlignment="Center" Text="Server url :" />
72-
<TextBox Width="400" Height="30" Margin="9,0,3,0" Text="{Binding Url}" VerticalContentAlignment="Center" />
191+
<StackPanel
192+
Grid.Row="9"
193+
Margin="0,5,110,5"
194+
HorizontalAlignment="Center"
195+
Orientation="Horizontal">
196+
<TextBlock VerticalAlignment="Center" Text="Server url :" />
197+
<TextBox
198+
Width="400"
199+
Height="35"
200+
Margin="9,0,3,0"
201+
VerticalContentAlignment="Center"
202+
Text="{Binding Url}" />
73203
</StackPanel>
74-
<StackPanel Margin="0,0,145,0" Grid.Row="10" Orientation="Horizontal" HorizontalAlignment="Center">
75-
<TextBlock VerticalAlignment="Center" Text="Currnet version :" />
76-
<TextBox Width="400" Height="30" Margin="9,0,3,0" Text="{Binding CurrentVersion}" VerticalContentAlignment="Center" />
204+
<StackPanel
205+
Grid.Row="10"
206+
Margin="0,0,145,0"
207+
HorizontalAlignment="Center"
208+
Orientation="Horizontal">
209+
<TextBlock VerticalAlignment="Center" Text="Currnet version :" />
210+
<TextBox
211+
Width="400"
212+
Height="35"
213+
Margin="9,0,3,0"
214+
VerticalContentAlignment="Center"
215+
Text="{Binding CurrentVersion}" />
77216
</StackPanel>
78-
<StackPanel Grid.Row="11" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
79-
<TextBlock VerticalAlignment="Center" Text="Driver dir :" />
80-
<TextBox Width="400" Height="30" Margin="9,0,3,0" Text="{Binding PatchPath}" VerticalContentAlignment="Center" />
81-
<Button Width="110" Height="30" Content="Pick driver" Command="{Binding SelectFolderCommand}" CommandParameter="Driver" />
217+
<StackPanel
218+
Grid.Row="11"
219+
Height="40"
220+
HorizontalAlignment="Center"
221+
Orientation="Horizontal">
222+
<TextBlock VerticalAlignment="Center" Text="Driver dir :" />
223+
<TextBox
224+
Width="400"
225+
Height="35"
226+
Margin="9,0,3,0"
227+
VerticalContentAlignment="Center"
228+
Text="{Binding PatchPath}" />
229+
<Button
230+
Width="110"
231+
Height="35"
232+
Command="{Binding SelectFolderCommand}"
233+
CommandParameter="Driver"
234+
Content="Pick driver" />
82235
</StackPanel>
83-
<StackPanel HorizontalAlignment="Center" Grid.Row="12" Orientation="Horizontal">
84-
<Button Margin="5" HorizontalAlignment="Center" Content="Build" Width="110" Height="30" Command="{Binding BuildCommand}" ToolTipService.ToolTip="The binary differential patch package is generated based on the difference between the two versions." />
85-
<CheckBox Margin="10,0,0,0" IsChecked="{Binding IsPublish}" Content="publish" VerticalAlignment="Center" />
236+
<StackPanel
237+
Grid.Row="12"
238+
HorizontalAlignment="Center"
239+
Orientation="Horizontal">
240+
<Button
241+
Width="110"
242+
Height="35"
243+
Margin="5"
244+
HorizontalAlignment="Center"
245+
Command="{Binding BuildCommand}"
246+
Content="Build"
247+
ToolTipService.ToolTip="The binary differential patch package is generated based on the difference between the two versions." />
248+
<CheckBox
249+
Margin="10,0,0,0"
250+
VerticalAlignment="Center"
251+
Content="publish"
252+
IsChecked="{Binding IsPublish}" />
86253
</StackPanel>
87254
</Grid>
88255
</UserControl>

0 commit comments

Comments
 (0)