mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Refactor: Move initial Windows settings population to core module
Moves the logic for the initial population of the Windows settings comboboxes from the UI's loaded event handler into the `Initialize-UIDefaults` function. This change centralizes UI default value setup into a single location, improving code organization and maintainability.
This commit is contained in:
@@ -151,9 +151,6 @@ $window.Add_Loaded({
|
|||||||
|
|
||||||
Register-EventHandlers -State $script:uiState
|
Register-EventHandlers -State $script:uiState
|
||||||
|
|
||||||
# Get Windows Settings UI using data from helper module
|
|
||||||
Get-WindowsSettingsCombos -isoPath $script:uiState.Defaults.windowsSettingsDefaults.DefaultISOPath -State $script:uiState
|
|
||||||
|
|
||||||
$script:uiState.Controls.txtISOPath.Add_TextChanged({
|
$script:uiState.Controls.txtISOPath.Add_TextChanged({
|
||||||
Get-WindowsSettingsCombos -isoPath $script:uiState.Controls.txtISOPath.Text -State $script:uiState
|
Get-WindowsSettingsCombos -isoPath $script:uiState.Controls.txtISOPath.Text -State $script:uiState
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -190,6 +190,9 @@ function Initialize-UIDefaults {
|
|||||||
$State.Controls.txtVMNamePrefix.Text = $State.Defaults.generalDefaults.VMNamePrefix
|
$State.Controls.txtVMNamePrefix.Text = $State.Defaults.generalDefaults.VMNamePrefix
|
||||||
$State.Controls.cmbLogicalSectorSize.SelectedItem = ($State.Controls.cmbLogicalSectorSize.Items | Where-Object { $_.Content -eq $State.Defaults.generalDefaults.LogicalSectorSize.ToString() })
|
$State.Controls.cmbLogicalSectorSize.SelectedItem = ($State.Controls.cmbLogicalSectorSize.Items | Where-Object { $_.Content -eq $State.Defaults.generalDefaults.LogicalSectorSize.ToString() })
|
||||||
|
|
||||||
|
# Populate Windows Release, Version, and SKU comboboxes
|
||||||
|
Get-WindowsSettingsCombos -isoPath $State.Defaults.windowsSettingsDefaults.DefaultISOPath -State $State
|
||||||
|
|
||||||
# Windows Settings tab defaults
|
# Windows Settings tab defaults
|
||||||
$State.Controls.cmbWindowsArch.ItemsSource = $State.Defaults.windowsSettingsDefaults.AllowedArchitectures
|
$State.Controls.cmbWindowsArch.ItemsSource = $State.Defaults.windowsSettingsDefaults.AllowedArchitectures
|
||||||
$State.Controls.cmbWindowsArch.SelectedItem = $State.Defaults.windowsSettingsDefaults.DefaultWindowsArch
|
$State.Controls.cmbWindowsArch.SelectedItem = $State.Defaults.windowsSettingsDefaults.DefaultWindowsArch
|
||||||
|
|||||||
Reference in New Issue
Block a user