Refactors CU checkbox initialization logic

Moves the initial state logic for the "Latest CU" and "Preview CU" checkboxes from the main UI script to the core initialization module.

This change centralizes UI default settings into the `Initialize-UIDefaults` function, improving code organization and maintainability.
This commit is contained in:
rbalsleyMSFT
2025-06-19 18:12:06 -07:00
parent cbc9ec4634
commit c946e56a41
2 changed files with 4 additions and 7 deletions
@@ -216,6 +216,9 @@ function Initialize-UIDefaults {
$State.Controls.chkUpdateLatestMSRT.IsChecked = $State.Defaults.generalDefaults.UpdateLatestMSRT
$State.Controls.chkUpdateLatestMicrocode.IsChecked = $State.Defaults.generalDefaults.UpdateLatestMicrocode
$State.Controls.chkUpdatePreviewCU.IsChecked = $State.Defaults.generalDefaults.UpdatePreviewCU
# Set initial state for CU checkbox interplay
$State.Controls.chkPreviewCU.IsEnabled = -not $State.Controls.chkLatestCU.IsChecked
$State.Controls.chkLatestCU.IsEnabled = -not $State.Controls.chkPreviewCU.IsChecked
# Applications tab defaults from General Defaults
$State.Controls.chkInstallApps.IsChecked = $State.Defaults.generalDefaults.InstallApps
@@ -249,7 +252,7 @@ function Initialize-UIDefaults {
$State.Controls.cmbMake.SelectedIndex = 0
}
Update-DriverDownloadPanelVisibility -State $State
# Set initial state for driver checkbox interplay
Update-DriverCheckboxStates -State $State