From 6b7351d1b32f6a8b9fa4851cb3e7ded261e658b2 Mon Sep 17 00:00:00 2001
From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com>
Date: Wed, 9 Jul 2025 14:49:42 -0700
Subject: [PATCH] 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.
---
FFUDevelopment/BuildFFUVM_UI.xaml | 4 ++--
.../FFUUI.Core/FFUUI.Core.Initialize.psm1 | 2 ++
.../FFUUI.Core/FFUUI.Core.WindowsSettings.psm1 | 14 ++++++++++++++
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/FFUDevelopment/BuildFFUVM_UI.xaml b/FFUDevelopment/BuildFFUVM_UI.xaml
index d83332d..d33fba3 100644
--- a/FFUDevelopment/BuildFFUVM_UI.xaml
+++ b/FFUDevelopment/BuildFFUVM_UI.xaml
@@ -345,7 +345,7 @@
-
+
@@ -355,7 +355,7 @@
-
+
diff --git a/FFUDevelopment/FFUUI.Core/FFUUI.Core.Initialize.psm1 b/FFUDevelopment/FFUUI.Core/FFUUI.Core.Initialize.psm1
index 887de8b..e9b1d37 100644
--- a/FFUDevelopment/FFUUI.Core/FFUUI.Core.Initialize.psm1
+++ b/FFUDevelopment/FFUUI.Core/FFUUI.Core.Initialize.psm1
@@ -9,8 +9,10 @@ function Initialize-UIControls {
$State.Controls.btnBrowseISO = $window.FindName('btnBrowseISO')
$State.Controls.cmbWindowsArch = $window.FindName('cmbWindowsArch')
$State.Controls.cmbWindowsLang = $window.FindName('cmbWindowsLang')
+ $State.Controls.WindowsLangStackPanel = $window.FindName('WindowsLangStackPanel')
$State.Controls.cmbWindowsSKU = $window.FindName('cmbWindowsSKU')
$State.Controls.cmbMediaType = $window.FindName('cmbMediaType')
+ $State.Controls.MediaTypeStackPanel = $window.FindName('MediaTypeStackPanel')
$State.Controls.txtOptionalFeatures = $window.FindName('txtOptionalFeatures')
$State.Controls.featuresPanel = $window.FindName('stackFeaturesContainer')
$State.Controls.chkDownloadDrivers = $window.FindName('chkDownloadDrivers')
diff --git a/FFUDevelopment/FFUUI.Core/FFUUI.Core.WindowsSettings.psm1 b/FFUDevelopment/FFUUI.Core/FFUUI.Core.WindowsSettings.psm1
index 1c5144d..42cbc6e 100644
--- a/FFUDevelopment/FFUUI.Core/FFUUI.Core.WindowsSettings.psm1
+++ b/FFUDevelopment/FFUUI.Core/FFUUI.Core.WindowsSettings.psm1
@@ -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