From 5ec607d94a1885847d35763b9c4b6f55013ea5b9 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Mon, 4 Aug 2025 17:39:17 -0700 Subject: [PATCH] Enforce 'Install Apps' selection for BYO apps Updates UI logic to automatically select the main 'Install Apps' option whenever the 'Bring Your Own Apps' option is selected. This ensures the parent category is always active when a user opts to bring their own applications, preventing an inconsistent UI state. The logic is applied both when updating panel visibility and when restoring checkbox states. --- FFUDevelopment/FFUUI.Core/FFUUI.Core.psm1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/FFUDevelopment/FFUUI.Core/FFUUI.Core.psm1 b/FFUDevelopment/FFUUI.Core/FFUUI.Core.psm1 index 70c497d..2e3f9c8 100644 --- a/FFUDevelopment/FFUUI.Core/FFUUI.Core.psm1 +++ b/FFUDevelopment/FFUUI.Core/FFUUI.Core.psm1 @@ -202,6 +202,11 @@ function Update-ApplicationPanelVisibility { [string]$TriggeringControlName # Optional: to know which control initiated the change ) + # If BYO apps is checked, ensure the main Install Apps is also checked. + if ($State.Controls.chkBringYourOwnApps.IsChecked) { + $State.Controls.chkInstallApps.IsChecked = $true + } + $installAppsChecked = $State.Controls.chkInstallApps.IsChecked # If the main 'Install Apps' is unchecked, everything below it gets hidden and reset. @@ -268,6 +273,12 @@ function Update-InstallAppsState { # If no state was saved (e.g., it was never forced), ensure it's unchecked. $installAppsChk.IsChecked = $false } + + # If BYO is checked, it overrides the restoration and keeps Install Apps checked. + if ($State.Controls.chkBringYourOwnApps.IsChecked) { + $installAppsChk.IsChecked = $true + } + $installAppsChk.IsEnabled = $true } }