mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-13 18:07:20 -06:00
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.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user