Add 'Bring Your Own Applications' checkbox and update visibility logic based on installation options

This commit is contained in:
rbalsleyMSFT
2025-02-19 17:52:44 -08:00
parent 802865c1a6
commit 9f3ee8d963
2 changed files with 24 additions and 3 deletions
+18 -2
View File
@@ -942,6 +942,17 @@ $window.Add_Loaded({
$script:wingetPanel.Visibility = 'Collapsed' $script:wingetPanel.Visibility = 'Collapsed'
}) })
# Bring Your Own Applications checkbox should only show if Install Applications is checked
$script:chkBringYourOwnApps = $window.FindName('chkBringYourOwnApps')
$script:chkBringYourOwnApps.Visibility = if ($script:chkInstallApps.IsChecked) { 'Visible' } else { 'Collapsed' }
$script:chkInstallApps.Add_Checked({
$script:chkBringYourOwnApps.Visibility = 'Visible'
})
$script:chkInstallApps.Add_Unchecked({
$script:chkBringYourOwnApps.IsChecked = $false
$script:chkBringYourOwnApps.Visibility = 'Collapsed'
})
# Show/Hide Winget panel based on checkbox state # Show/Hide Winget panel based on checkbox state
$script:chkInstallWingetApps.Add_Checked({ $script:chkInstallWingetApps.Add_Checked({
$script:wingetPanel.Visibility = 'Visible' $script:wingetPanel.Visibility = 'Visible'
@@ -1043,7 +1054,6 @@ $window.Add_Loaded({
# Show search panel after successful Winget validation # Show search panel after successful Winget validation
$script:btnCheckWingetModule.Add_Click({ $script:btnCheckWingetModule.Add_Click({
# ...existing code...
try { try {
# Check Winget CLI first # Check Winget CLI first
$cliStatus = Test-WingetCLI $cliStatus = Test-WingetCLI
@@ -1060,7 +1070,13 @@ $window.Add_Loaded({
} }
} }
catch { catch {
# ...existing error handling code... Update-WingetVersionFields -wingetText "Error" -moduleText "Error"
[System.Windows.MessageBox]::Show(
"Error checking winget components: $_",
"Error",
"OK",
"Error"
)
} }
}) })
+6 -1
View File
@@ -602,7 +602,7 @@
<!-- Winget Search Panel --> <!-- Winget Search Panel -->
<StackPanel x:Name="wingetSearchPanel" <StackPanel x:Name="wingetSearchPanel"
Visibility="Collapsed" Visibility="Collapsed"
Margin="25,10,5,5"> Margin="25,10,5,20">
<TextBlock Text="Winget Search" <TextBlock Text="Winget Search"
FontWeight="Bold" FontWeight="Bold"
@@ -655,6 +655,11 @@
ToolTip="Clear all applications from the list"/> ToolTip="Clear all applications from the list"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<CheckBox x:Name="chkBringYourOwnApps"
Content="Bring Your Own Applications"
Margin="5"
ToolTip="Enable to bring your own applications during the build process"/>
</StackPanel> </StackPanel>
</Grid> </Grid>
</TabItem> </TabItem>