|
6 | 6 | xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity" |
7 | 7 | xmlns:ia="clr-namespace:Avalonia.Xaml.Interactions.Core;assembly=Avalonia.Xaml.Interactions" |
8 | 8 | xmlns:vm="clr-namespace:GeneralUpdate.Tool.Avalonia.ViewModels" |
| 9 | + xmlns:u="https://irihi.tech/ursa" |
9 | 10 | x:Class="GeneralUpdate.Tool.Avalonia.Views.PacketView" x:DataType="vm:PacketViewModel"> |
10 | 11 | <i:Interaction.Behaviors> |
11 | 12 | <ia:EventTriggerBehavior EventName="Loaded"> |
|
16 | 17 | <ScrollViewer> |
17 | 18 | <StackPanel Margin="10"> |
18 | 19 | <!-- Required Fields Section --> |
19 | | - <TextBlock |
20 | | - Text="Required Fields" |
21 | | - FontWeight="Bold" |
22 | | - FontSize="14" |
23 | | - Margin="0,5,0,5" /> |
24 | | - <Separator Margin="0,0,0,10" /> |
25 | | - |
26 | | - <Grid ColumnDefinitions="1*,4*,1*" RowDefinitions="Auto,Auto,Auto,Auto,Auto"> |
27 | | - <!-- UpdateUrl (Required) --> |
28 | | - <TextBlock |
29 | | - HorizontalAlignment="Right" |
30 | | - VerticalAlignment="Center" |
31 | | - Text="UpdateUrl*" /> |
32 | | - <TextBox |
33 | | - Grid.Column="1" |
34 | | - Margin="5" |
35 | | - Text="{Binding ConfigModel.UpdateUrl}" /> |
36 | | - |
37 | | - <!-- ReportUrl (Required) --> |
38 | | - <TextBlock |
39 | | - Grid.Row="1" |
40 | | - HorizontalAlignment="Right" |
41 | | - VerticalAlignment="Center" |
42 | | - Text="ReportUrl*" /> |
43 | | - <TextBox |
44 | | - Grid.Row="1" |
45 | | - Grid.Column="1" |
46 | | - Margin="5" |
47 | | - Text="{Binding ConfigModel.ReportUrl}" /> |
48 | | - |
49 | | - <!-- AppDirectory (Required) --> |
50 | | - <TextBlock |
51 | | - Grid.Row="2" |
52 | | - HorizontalAlignment="Right" |
53 | | - VerticalAlignment="Center" |
54 | | - Text="AppDirectory*" /> |
55 | | - <TextBox |
56 | | - Grid.Row="2" |
57 | | - Grid.Column="1" |
58 | | - Margin="5" |
59 | | - Text="{Binding ConfigModel.AppDirectory}" /> |
60 | | - <Button |
61 | | - Grid.Row="2" |
62 | | - Grid.Column="2" |
63 | | - Margin="5" |
64 | | - Classes="Primary" |
65 | | - Command="{Binding SelectFolderCommand}" |
66 | | - CommandParameter="App" Content="Pick" |
67 | | - Theme="{DynamicResource SolidButton}" > |
68 | | - </Button> |
69 | | - |
70 | | - <!-- ReleaseDirectory (Required) --> |
71 | | - <TextBlock |
72 | | - Grid.Row="3" |
73 | | - HorizontalAlignment="Right" |
74 | | - VerticalAlignment="Center" |
75 | | - Text="ReleaseDirectory*" /> |
76 | | - <TextBox |
77 | | - Grid.Row="3" |
78 | | - Grid.Column="1" |
79 | | - Margin="5" |
80 | | - Text="{Binding ConfigModel.ReleaseDirectory}" /> |
81 | | - <Button |
82 | | - Grid.Row="3" |
83 | | - Grid.Column="2" |
84 | | - Margin="5" |
85 | | - Classes="Primary" |
86 | | - Command="{Binding SelectFolderCommand}" |
87 | | - CommandParameter="Release" Content="Pick" |
88 | | - Theme="{DynamicResource SolidButton}"> |
89 | | - </Button> |
90 | | - |
91 | | - <!-- PatchDirectory (Required) --> |
92 | | - <TextBlock |
93 | | - Grid.Row="4" |
94 | | - HorizontalAlignment="Right" |
95 | | - VerticalAlignment="Center" |
96 | | - Text="PatchDirectory*" /> |
97 | | - <TextBox |
98 | | - Grid.Row="4" |
99 | | - Grid.Column="1" |
100 | | - Margin="5" |
101 | | - Text="{Binding ConfigModel.PatchDirectory}" /> |
102 | | - <Button |
103 | | - Grid.Row="4" |
104 | | - Grid.Column="2" |
105 | | - Margin="5" |
106 | | - Classes="Primary" |
107 | | - Command="{Binding SelectFolderCommand}" |
108 | | - CommandParameter="Patch" Content="Pick" |
109 | | - Theme="{DynamicResource SolidButton}"> |
110 | | - </Button> |
111 | | - </Grid> |
112 | | - |
113 | | - <!-- Optional Fields Section --> |
114 | | - <TextBlock |
115 | | - Text="Optional Fields" |
116 | | - FontWeight="Bold" |
117 | | - FontSize="14" |
118 | | - Margin="0,15,0,5" /> |
119 | | - <Separator Margin="0,0,0,10" /> |
120 | | - |
121 | | - <Grid ColumnDefinitions="1*,4*,1*" RowDefinitions="Auto"> |
122 | | - <!-- DriverDirectory (Optional) --> |
123 | | - <TextBlock |
124 | | - HorizontalAlignment="Right" |
125 | | - VerticalAlignment="Center" |
126 | | - Text="DriverDirectory" /> |
127 | | - <TextBox |
128 | | - Grid.Column="1" |
129 | | - Margin="5" |
130 | | - Text="{Binding ConfigModel.DriverDirectory, Mode=TwoWay}" /> |
131 | | - <Button |
132 | | - Grid.Column="2" |
133 | | - Margin="5" |
134 | | - Classes="Primary" |
135 | | - Command="{Binding SelectFolderCommand}" |
136 | | - CommandParameter="Driver" Content="Pick" |
137 | | - Theme="{DynamicResource SolidButton}"> |
138 | | - </Button> |
139 | | - </Grid> |
| 20 | + <u:Divider Content="Required Fields"/> |
| 21 | + <u:Form LabelPosition="Left" LabelWidth="*" Margin="10"> |
| 22 | + <StackPanel Orientation="Horizontal" u:FormItem.IsRequired="True" u:FormItem.Label="ServerAddress"> |
| 23 | + <TextBox Width="400" Text="{Binding ConfigModel.ServerAddress}" /> |
| 24 | + </StackPanel> |
| 25 | + <StackPanel Orientation="Horizontal" u:FormItem.IsRequired="True" u:FormItem.Label="AppDirectory" > |
| 26 | + <TextBox Width="400" Text="{Binding ConfigModel.AppDirectory}"/> |
| 27 | + <Button Margin="5,0,0,0" |
| 28 | + Classes="Primary" |
| 29 | + Command="{Binding SelectFolderCommand}" |
| 30 | + CommandParameter="App" |
| 31 | + Content="Pick" |
| 32 | + Theme="{DynamicResource SolidButton}" > |
| 33 | + </Button> |
| 34 | + </StackPanel> |
| 35 | + <StackPanel Orientation="Horizontal" u:FormItem.IsRequired="True" u:FormItem.Label="ReleaseDirectory" > |
| 36 | + <TextBox Width="400" Text="{Binding ConfigModel.ReleaseDirectory}" /> |
| 37 | + <Button Margin="5,0,0,0" |
| 38 | + Classes="Primary" |
| 39 | + Command="{Binding SelectFolderCommand}" |
| 40 | + CommandParameter="Release" |
| 41 | + Content="Pick" |
| 42 | + Theme="{DynamicResource SolidButton}"> |
| 43 | + </Button> |
| 44 | + </StackPanel> |
| 45 | + </u:Form> |
140 | 46 |
|
141 | 47 | <!-- Auto-generated Fields Section --> |
142 | | - <TextBlock |
143 | | - Text="Auto-generated Fields" |
144 | | - FontWeight="Bold" |
145 | | - FontSize="14" |
146 | | - Margin="0,15,0,5" /> |
147 | | - <Separator Margin="0,0,0,10" /> |
148 | | - |
149 | | - <Grid ColumnDefinitions="1*,4*,1*" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto"> |
150 | | - <!-- AppName (Auto-generated) --> |
151 | | - <TextBlock |
152 | | - HorizontalAlignment="Right" |
153 | | - VerticalAlignment="Center" |
154 | | - Text="AppName" /> |
155 | | - <TextBox |
156 | | - Grid.Column="1" |
157 | | - Margin="5" |
158 | | - IsReadOnly="True" |
159 | | - Text="{Binding ConfigModel.AppName, Mode=OneWay}" /> |
160 | | - |
161 | | - <!-- MainAppName (Auto-generated) --> |
162 | | - <TextBlock |
163 | | - Grid.Row="1" |
164 | | - HorizontalAlignment="Right" |
165 | | - VerticalAlignment="Center" |
166 | | - Text="MainAppName" /> |
167 | | - <TextBox |
168 | | - Grid.Row="1" |
169 | | - Grid.Column="1" |
170 | | - Margin="5" |
171 | | - IsReadOnly="True" |
172 | | - Text="{Binding ConfigModel.MainAppName, Mode=OneWay}" /> |
173 | | - |
174 | | - <!-- ClientVersion (Auto-generated) --> |
175 | | - <TextBlock |
176 | | - Grid.Row="2" |
177 | | - HorizontalAlignment="Right" |
178 | | - VerticalAlignment="Center" |
179 | | - Text="ClientVersion" /> |
180 | | - <TextBox |
181 | | - Grid.Row="2" |
182 | | - Grid.Column="1" |
183 | | - Margin="5" |
184 | | - IsReadOnly="True" |
185 | | - Text="{Binding ConfigModel.ClientVersion, Mode=OneWay}" /> |
186 | | - |
187 | | - <!-- PacketName (Auto-generated) --> |
188 | | - <TextBlock |
189 | | - Grid.Row="3" |
190 | | - HorizontalAlignment="Right" |
191 | | - VerticalAlignment="Center" |
192 | | - Text="PacketName" /> |
193 | | - <TextBox |
194 | | - Grid.Row="3" |
195 | | - Grid.Column="1" |
196 | | - Margin="5" |
197 | | - IsReadOnly="True" |
198 | | - Text="{Binding ConfigModel.Name, Mode=OneWay}" /> |
199 | | - |
200 | | - <!-- Format (Auto-generated) --> |
201 | | - <TextBlock |
202 | | - Grid.Row="4" |
203 | | - HorizontalAlignment="Right" |
204 | | - VerticalAlignment="Center" |
205 | | - Text="Format" /> |
206 | | - <ComboBox |
207 | | - Grid.Row="4" |
208 | | - Grid.Column="1" |
209 | | - MinWidth="150" |
210 | | - Margin="5" |
211 | | - ItemsSource="{Binding Formats}" |
212 | | - SelectedItem="{Binding ConfigModel.Format}" /> |
213 | | - |
214 | | - <!-- Encoding (Auto-generated) --> |
215 | | - <TextBlock |
216 | | - Grid.Row="5" |
217 | | - HorizontalAlignment="Right" |
218 | | - VerticalAlignment="Center" |
219 | | - Text="Encoding" /> |
220 | | - <ComboBox |
221 | | - Grid.Row="5" |
222 | | - Grid.Column="1" |
223 | | - MinWidth="150" |
224 | | - Margin="5" |
225 | | - ItemsSource="{Binding Encodings}" |
226 | | - SelectedIndex="0" |
227 | | - SelectedItem="{Binding ConfigModel.Encoding}" /> |
228 | | - </Grid> |
| 48 | + <u:Divider Content="Auto-generated Fields"/> |
| 49 | + <u:Form LabelPosition="Left" LabelWidth="*" Margin="10"> |
| 50 | + <TextBox Width="400" u:FormItem.Label="UpdateUrl" Text="{Binding ConfigModel.UpdateUrl}" /> |
| 51 | + <TextBox Width="400" u:FormItem.Label="ReportUrl" Text="{Binding ConfigModel.ReportUrl}"/> |
| 52 | + <TextBox Width="400" u:FormItem.Label="AppName" Text="{Binding ConfigModel.AppName, Mode=OneWay}" /> |
| 53 | + <TextBox Width="400" u:FormItem.Label="MainAppName" Text="{Binding ConfigModel.MainAppName, Mode=OneWay}" /> |
| 54 | + <TextBox Width="400" u:FormItem.Label="ClientVersion" Text="{Binding ConfigModel.ClientVersion, Mode=OneWay}" /> |
| 55 | + <TextBox Width="400" u:FormItem.Label="PacketName" Text="{Binding ConfigModel.Name, Mode=OneWay}" /> |
| 56 | + <ComboBox u:FormItem.Label="Format" Width="400" ItemsSource="{Binding Formats}" SelectedItem="{Binding ConfigModel.Format}" /> |
| 57 | + <ComboBox u:FormItem.Label="Encoding" Width="400" ItemsSource="{Binding Encodings}" SelectedIndex="0" SelectedItem="{Binding ConfigModel.Encoding}" /> |
| 58 | + <StackPanel Orientation="Horizontal" u:FormItem.Label="PatchDirectory"> |
| 59 | + <TextBox Width="400" Text="{Binding ConfigModel.PatchDirectory}" /> |
| 60 | + <Button Margin="5,0,0,0" |
| 61 | + Classes="Primary" |
| 62 | + Command="{Binding SelectFolderCommand}" |
| 63 | + CommandParameter="Patch" |
| 64 | + Content="Pick" |
| 65 | + Theme="{DynamicResource SolidButton}"> |
| 66 | + </Button> |
| 67 | + </StackPanel> |
| 68 | + </u:Form> |
229 | 69 | </StackPanel> |
230 | 70 | </ScrollViewer> |
231 | 71 | <StackPanel |
|
235 | 75 | VerticalAlignment="Center" |
236 | 76 | Orientation="Horizontal" |
237 | 77 | Spacing="10"> |
238 | | - <Button |
| 78 | + <u:IconButton |
239 | 79 | Classes="Primary" |
240 | 80 | Command="{Binding BuildCommand}" |
241 | 81 | Theme="{DynamicResource SolidButton}" Content="Build"> |
242 | | - </Button> |
| 82 | + </u:IconButton> |
243 | 83 | <Button |
244 | 84 | Classes="Primary" |
245 | 85 | Command="{Binding ClearCommand}" |
|
0 commit comments