Hides download settings when using a local ISO

Updates the UI to conditionally hide the Windows language and media type controls. These settings are only applicable when downloading a new image and are irrelevant when a local ISO file is provided.

This change simplifies the user interface and prevents confusion by only showing options relevant to the selected action.
This commit is contained in:
rbalsleyMSFT
2025-07-09 14:49:42 -07:00
parent 878b93889f
commit 6b7351d1b3
3 changed files with 18 additions and 2 deletions
@@ -564,6 +564,20 @@ function Get-WindowsSettingsCombos {
[psobject]$State
)
# Determine visibility for download-specific controls based on ISO path
$visibility = if (-not [string]::IsNullOrEmpty($isoPath) -and $isoPath.EndsWith('.iso', [System.StringComparison]::OrdinalIgnoreCase)) {
'Collapsed'
}
else {
'Visible'
}
# Set visibility for Language and Media Type controls
$State.Controls.WindowsLangStackPanel.Visibility = $visibility
$State.Controls.cmbWindowsLang.Visibility = $visibility
$State.Controls.MediaTypeStackPanel.Visibility = $visibility
$State.Controls.cmbMediaType.Visibility = $visibility
# Update Release combo first
Update-WindowsReleaseCombo -isoPath $isoPath -State $State