mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Refactor UI config logic into a core module
Moves the logic for saving and loading configuration files from the main UI script into the `FFUUI.Core.Config` module. This change improves modularity and separation of concerns, making the code easier to maintain. The main `BuildFFUVM_UI.ps1` script is simplified, with event handlers now calling the new, dedicated functions in the core module to manage configuration state. Also corrects the path for the `FFUConfig.json` file.
This commit is contained in:
@@ -723,5 +723,18 @@ function Register-EventHandlers {
|
||||
$localState = $window.Tag
|
||||
Import-DriversJson -State $localState
|
||||
})
|
||||
|
||||
$State.Controls.btnLoadConfig.Add_Click({
|
||||
param($eventSource, $routedEventArgs)
|
||||
$window = [System.Windows.Window]::GetWindow($eventSource)
|
||||
$localState = $window.Tag
|
||||
Invoke-LoadConfiguration -State $localState
|
||||
})
|
||||
$State.Controls.btnBuildConfig.Add_Click({
|
||||
param($eventSource, $routedEventArgs)
|
||||
$window = [System.Windows.Window]::GetWindow($eventSource)
|
||||
$localState = $window.Tag
|
||||
Invoke-SaveConfiguration -State $localState
|
||||
})
|
||||
}
|
||||
Export-ModuleMember -Function *
|
||||
Reference in New Issue
Block a user