Skip to content

Commit efbde0d

Browse files
authored
Merge pull request #23 from microsoft/tanaka-modpackageschema
MainPackage UI Refactoring
2 parents 1c64505 + bcd3b68 commit efbde0d

3 files changed

Lines changed: 81 additions & 61 deletions

File tree

AppInstallerFileBuilder/AppInstallerFileBuilder/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
3-
<Identity Name="AppInstallerFileBuilder" Publisher="CN=MSIX-Toolkit-Tempkey" Version="1.2019.812.0" />
3+
<Identity Name="AppInstallerFileBuilder" Publisher="CN=MSIX-Toolkit-Tempkey" Version="1.2019.1001.0" />
44
<mp:PhoneIdentity PhoneProductId="4a19f631-5573-4e7d-9544-322a5adf9868" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
55
<Properties>
66
<DisplayName>AppInstaller File Builder (Preview)</DisplayName>

AppInstallerFileBuilder/AppInstallerFileBuilder/Views/MainPackageView.xaml

Lines changed: 72 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
mc:Ignorable="d">
1010

1111
<RelativePanel>
12-
<ScrollViewer VerticalScrollMode="Enabled" VerticalScrollBarVisibility="Visible">
13-
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="{StaticResource PageMargin}">
12+
<ScrollViewer VerticalScrollMode="Enabled" VerticalScrollBarVisibility="Visible" x:Name="Main_ScrollViewer">
13+
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="{StaticResource PageMargin}" MinHeight="917" MinWidth="637">
1414
<Grid.RowDefinitions>
1515
<RowDefinition Height="Auto"/>
1616
<RowDefinition Height="Auto"/>
@@ -51,7 +51,7 @@
5151
Width="453"
5252
Margin="0,0,15,0"
5353
/>
54-
<Button x:Name="PackageInfoButton" Content="Get Package Info">
54+
<Button x:Name="PackageInfoButton" Content="Get Package Info" Margin="12,0,0,0">
5555

5656
</Button>
5757
</StackPanel>
@@ -61,7 +61,7 @@
6161
<StackPanel Margin="{StaticResource SettingsSubheaderMargin}" Orientation="Horizontal">
6262
<TextBlock
6363
ToolTipService.ToolTip="e.g. MyCompany.MySuite.MyApp"
64-
Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15" Margin="5" VerticalAlignment="Center">
64+
Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15" Margin="5" VerticalAlignment="Center" Width="185">
6565
<Run Text="Name" />
6666
<Run Text="*" Foreground="Red" />
6767
</TextBlock>
@@ -73,14 +73,14 @@
7373
PlaceholderText="Package Name"
7474
HorizontalAlignment="Left"
7575
Width="400"
76-
Margin="141,0,0,0"
76+
Margin="10,0,0,0"
7777
/>
7878
</StackPanel >
7979

8080
<StackPanel Margin="{StaticResource SettingsSubheaderMargin}" Orientation="Horizontal">
8181
<TextBlock
8282
ToolTipService.ToolTip="e.g. 1.0.0.0"
83-
Style="{StaticResource SubtitleTextBlockStyle}" Margin="5" FontSize="15" VerticalAlignment="Center" Windows10FallCreatorsUpdate:HorizontalTextAlignment="Right">
83+
Style="{StaticResource SubtitleTextBlockStyle}" Margin="5" FontSize="15" VerticalAlignment="Center" Windows10FallCreatorsUpdate:HorizontalTextAlignment="Left" Width="185">
8484
<Run Text="Version" />
8585
<Run Text="*" Foreground="Red" />
8686
</TextBlock>
@@ -93,14 +93,14 @@
9393
ToolTipService.ToolTip="e.g. 1.0.0.0"
9494
HorizontalAlignment="Left"
9595
Width="400"
96-
Margin="132,0,0,0"
96+
Margin="10,0,0,0"
9797
/>
9898
</StackPanel>
9999

100100
<StackPanel Margin="{StaticResource SettingsSubheaderMargin}" Orientation="Horizontal">
101101
<TextBlock
102102
ToolTipService.ToolTip="e.g. CN=janedoe"
103-
Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15" Margin="5" VerticalAlignment="Center">
103+
Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15" Margin="5" VerticalAlignment="Center" Width="185">
104104
<Run Text="Publisher" />
105105
<Run Text="*" Foreground="Red" />
106106
</TextBlock>
@@ -112,15 +112,15 @@
112112
PlaceholderText="Publisher"
113113
HorizontalAlignment="Left"
114114
Width="400"
115-
Margin="121,0,0,0"
115+
Margin="10,0,0,0"
116116
/>
117117
</StackPanel>
118118

119119
<StackPanel x:Name="Resource_Id_Stack_Panel" Margin="{StaticResource SettingsSubheaderMargin}" Orientation="Horizontal">
120120
<TextBlock
121121
x:Uid="Resource_Id"
122122
ToolTipService.ToolTip="e.g. English"
123-
Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15" Margin="5" VerticalAlignment="Center">
123+
Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15" Margin="5" VerticalAlignment="Center" Width="185">
124124
<Run Text="Resource Id"/>
125125
</TextBlock>
126126
<TextBox
@@ -131,13 +131,13 @@
131131
PlaceholderText="Resource Id"
132132
HorizontalAlignment="Left"
133133
Width="400"
134-
Margin="116,0,0,0"
134+
Margin="10,0,0,0"
135135
/>
136136
</StackPanel>
137137

138138
<StackPanel Margin="{StaticResource SettingsSubheaderMargin}" x:Name="Processor_Type_Stack_Panel" Orientation="Horizontal">
139139
<TextBlock
140-
Style="{StaticResource SubtitleTextBlockStyle}" Margin="5" VerticalAlignment="Center" FontSize="15">
140+
Style="{StaticResource SubtitleTextBlockStyle}" Margin="5" VerticalAlignment="Center" FontSize="15" Width="185">
141141
<Run Text="Processor Architecture Type" />
142142
</TextBlock>
143143

@@ -149,14 +149,14 @@
149149
PlaceholderText="Processor Architecture"
150150
HorizontalAlignment="Left"
151151
Width="400"
152-
Margin="8,0,0,0"
152+
Margin="10,0,0,0"
153153
/>
154154
</StackPanel>
155155

156156
<StackPanel Margin="{StaticResource SettingsSubheaderMargin}" Orientation="Horizontal">
157157
<TextBlock
158158
ToolTipService.ToolTip="e.g. C:\Users\JaneDoe\Desktop\MyApp.msix"
159-
Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15" Margin="5" VerticalAlignment="Center"
159+
Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15" Margin="5" VerticalAlignment="Center" Width="185"
160160
>
161161
<Run Text="File Path" />
162162
<Run Text="*" Foreground="Red"/>
@@ -169,102 +169,114 @@
169169
PlaceholderText="Enter the package URI"
170170
ToolTipService.ToolTip="e.g. C:\Users\JaneDoe\Desktop\MyApp.msix"
171171
HorizontalAlignment="Left"
172-
Width="518"
173-
Margin="8,0,0,0"
172+
Width="400"
173+
Margin="10,0,0,0"
174174
/>
175175
</StackPanel>
176176
</StackPanel>
177-
177+
178178
<StackPanel Margin="{StaticResource SettingsSubheaderMargin}" Orientation="Horizontal">
179179
<TextBlock
180180
x:Uid="Check_For_Updates"
181-
Style="{StaticResource SubtitleTextBlockStyle}" Padding="1,0,0,0" FontSize="15"
182-
Margin="5" VerticalAlignment="Center"
181+
Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15"
182+
VerticalAlignment="Center"
183+
Margin="5"
184+
Width="185"
183185
/>
184186
<ToggleSwitch
185187
x:Uid="Check_For_Updates_Switch"
186188
x:Name="Check_For_Updates_Switch"
187189
IsOn="{Binding IsCheckUpdates}"
188190
Toggled="ToggleSwitch_Toggled"
191+
Margin="10,0,0,0"
189192
/>
190193
</StackPanel>
191194

192-
<StackPanel Margin="{StaticResource SettingsSubheaderMargin}" x:Name="Update_Settings_Stack_Panel">
193-
<StackPanel x:Name="Compatibility_Stack_Panel" Orientation="Horizontal">
195+
<StackPanel x:Name="Update_Settings_Stack_Panel">
196+
<StackPanel x:Name="Compatibility_Stack_Panel" Orientation="Horizontal" Margin="{StaticResource SettingsSubheaderMargin}">
194197
<TextBlock
195198
x:Uid="compat_text_block"
196199
Text="Min OS Version:"
197200
Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15"
198201
Margin="5" VerticalAlignment="Center"
199-
/>
200-
<ComboBox x:Name="CompatComboBox" x:Uid="CompatComboBox" PlaceholderText="Choose the min Win10 OS version" ItemsSource="{x:Bind Schemas}" SelectionChanged="CompatComboBox_SelectionChanged"/>
202+
Width="185"/>
203+
<ComboBox x:Name="CompatComboBox" x:Uid="CompatComboBox" PlaceholderText="Choose the min Win10 OS version" ItemsSource="{x:Bind Path=Schemas}" SelectionChanged="CompatComboBox_SelectionChanged" Margin="10,0,0,0"/>
201204
</StackPanel>
202-
203-
<StackPanel Orientation="Horizontal" x:Name="One_Update_Settings_Stack_Panel" x:Uid="One_Update_Settings_Stack_Panel" Visibility="Collapsed">
204-
205+
<StackPanel Orientation="Vertical" x:Name="One_Update_Settings_Stack_Panel" x:Uid="One_Update_Settings_Stack_Panel" Visibility="Collapsed">
205206
</StackPanel>
206-
207-
<StackPanel Orientation="Horizontal" x:Name="Two_Update_Settings_Stack_Panel" x:Uid="Two_Update_Settings_Stack_Panel" Visibility="Collapsed">
208-
<TextBlock
209-
x:Uid="Update_Frequency_Text_Block"
210-
Text="Hours between update checks"
211-
Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15"
212-
Margin="5" VerticalAlignment="Center"
207+
<StackPanel Orientation="Vertical" x:Name="Two_Update_Settings_Stack_Panel" x:Uid="Two_Update_Settings_Stack_Panel" Visibility="Collapsed">
208+
<StackPanel Orientation="Horizontal" Margin="{StaticResource SettingsSubheaderMargin}">
209+
<TextBlock x:Uid="Update_Frequency_Text_Block"
210+
Text="Hours between update checks"
211+
Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15"
212+
Width="185" VerticalAlignment="Center"
213+
Margin="5"
213214
/>
214215
<TextBox
215216
x:Uid="Hours_Between_Updates_Text_Box"
216217
x:Name="Hours_Between_Updates_Text_Box"
217218
PlaceholderText="12"
218219
Width="70"
219220
HorizontalAlignment="Left"
220-
FontSize="15" Margin="5" VerticalAlignment="Center"
221+
FontSize="15" Margin="10,0,0,0" VerticalAlignment="Center"
221222
/>
222-
223-
<TextBlock Text="Auto background update" Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15"
224-
Margin="5" VerticalAlignment="Center" />
225-
<ToggleSwitch
226-
Margin="21,0,0,0"
223+
</StackPanel>
224+
225+
<StackPanel Orientation="Horizontal" Margin="{StaticResource SettingsSubheaderMargin}">
226+
<TextBlock Text="Auto background update checks" Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15"
227+
Width="185" Margin="5"
228+
VerticalAlignment="Center" />
229+
<ToggleSwitch
230+
Margin="10,0,0,0"
227231
x:Uid="Auto_Update_Switch"
228232
x:Name="Auto_Update_Switch"
229233
IsOn="{Binding IsAutoUpdate}"
230234
Toggled="Auto_Update_Switch_Toggled"
235+
HorizontalAlignment="Right"
231236
/>
237+
</StackPanel>
232238
</StackPanel>
233-
234-
<StackPanel Orientation="Horizontal" x:Name="Three_Update_Settings_Stack_Panel" x:Uid="Three_Update_Settings_Stack_Panel" Visibility="Collapsed">
235-
<TextBlock Text="Force update" Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15"
236-
Margin="5" VerticalAlignment="Center" />
237-
<ToggleSwitch
238-
Margin="21,0,0,0"
239-
x:Uid="Force_Update_Switch"
240-
x:Name="Force_Update_Switch"
241-
IsOn="{Binding IsForcedUpdate}"
242-
Toggled="Force_Update_Switch_Toggled"
243-
/>
244-
245-
<TextBlock Text="Show prompt" Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15"
246-
Margin="5" VerticalAlignment="Center"/>
247-
<ToggleSwitch
248-
Margin="21,0,0,0"
239+
<StackPanel Orientation="Vertical" x:Name="Three_Update_Settings_Stack_Panel" x:Uid="Three_Update_Settings_Stack_Panel" Visibility="Collapsed">
240+
<StackPanel Orientation="Horizontal" Margin="{StaticResource SettingsSubheaderMargin}">
241+
<TextBlock Text="Show update prompt" Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15"
242+
Width="185" Margin="5" VerticalAlignment="Center"/>
243+
<ToggleSwitch
244+
Margin="10,0,0,0"
249245
x:Uid="Show_Prompt_Switch"
250246
x:Name="Show_Prompt_Switch"
251247
IsOn="{Binding IsShowPrompt}"
252248
Toggled="Show_Prompt_Switch_Toggled"
249+
HorizontalAlignment="Right"
253250
/>
254-
<TextBlock Text="Blocking update" Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15"
255-
Margin="31,5,5,5" VerticalAlignment="Center"/>
256-
<ToggleSwitch
257-
Margin="2,0,0,0"
251+
</StackPanel>
252+
<StackPanel Orientation="Horizontal" Margin="{StaticResource SettingsSubheaderMargin}">
253+
<TextBlock Text="Update blocks activation" Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15"
254+
Width="185" Margin="5" VerticalAlignment="Center"/>
255+
<ToggleSwitch
256+
Margin="10,0,0,0"
258257
x:Uid="Block_Update_Switch"
259258
x:Name="Block_Update_Switch"
260259
IsOn="{Binding IsBlockingUpdate}"
261260
Toggled="Block_Update_Switch_Toggled"
261+
HorizontalAlignment="Right"
262262
/>
263+
</StackPanel>
264+
<StackPanel Orientation="Horizontal" Margin="{StaticResource SettingsSubheaderMargin}">
265+
<TextBlock Text="Force update to version" Style="{StaticResource SubtitleTextBlockStyle}" FontSize="15"
266+
Width="185" Margin="5" VerticalAlignment="Center" />
267+
<ToggleSwitch
268+
Margin="10,0,0,0"
269+
x:Uid="Force_Update_Switch"
270+
x:Name="Force_Update_Switch"
271+
IsOn="{Binding IsForcedUpdate}"
272+
Toggled="Force_Update_Switch_Toggled"
273+
HorizontalAlignment="Right"
274+
/>
275+
</StackPanel>
263276
</StackPanel>
264277

265278
</StackPanel>
266279

267-
268280
</StackPanel>
269281
</Grid>
270282
</ScrollViewer>

AppInstallerFileBuilder/AppInstallerFileBuilder/Views/MainPackageView.xaml.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public sealed partial class MainPackageView : Page
5959
private StackPanel _1809updateSettingsStackPanel;
6060

6161
private int _hoursBetweenUpdates;
62+
private ScrollViewer _scrollViewer;
6263

6364
/***************************************************************************
6465
*
@@ -79,6 +80,7 @@ public MainPackageView()
7980
_uriPathTextBox = (TextBox)this.FindName("Uri_Path_Text_Box");
8081
_processorTypeStackPanel = (StackPanel)this.FindName("Processor_Type_Stack_Panel");
8182
_resourceIdStackPanel = (StackPanel)this.FindName("Resource_Id_Stack_Panel");
83+
_scrollViewer = (ScrollViewer)this.FindName("Main_ScrollViewer");
8284

8385
PackageInfoButton.Click += new RoutedEventHandler(PackageInfoButton_Click);
8486

@@ -312,6 +314,7 @@ private void CompatComboBox_SelectionChanged(object sender, SelectionChangedEven
312314
_1803updateSettingsStackPanel.Visibility = Visibility.Visible;
313315
_1709updateSettingsStackPanel.Visibility = Visibility.Visible;
314316
App.AppInstallerFileSchemaNamespace = "http://schemas.microsoft.com/appx/appinstaller/2018";
317+
_scrollViewer.ChangeView(0.0f, _scrollViewer.ScrollableHeight, 1.0f);
315318
break;
316319
case 1: //1803 and above
317320
Debug.WriteLine("1");
@@ -321,6 +324,7 @@ private void CompatComboBox_SelectionChanged(object sender, SelectionChangedEven
321324
_showPromptSwitch.IsOn = false;
322325
_blockUpdateSwitch.IsOn = false;
323326
App.AppInstallerFileSchemaNamespace = "http://schemas.microsoft.com/appx/appinstaller/2017/2";
327+
_scrollViewer.ChangeView(0.0f, _scrollViewer.ScrollableHeight/2.5, 1.0f);
324328
break;
325329
case 2: //1709 and above
326330
Debug.WriteLine("2");
@@ -369,5 +373,9 @@ private void Auto_Update_Switch_Toggled(object sender, RoutedEventArgs e)
369373

370374
}
371375

376+
private void TextBlock_SelectionChanged(object sender, RoutedEventArgs e)
377+
{
378+
379+
}
372380
}
373381
}

0 commit comments

Comments
 (0)