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:
rbalsleyMSFT
2025-06-20 14:25:39 -07:00
parent 9871d1c23b
commit d0c5ddc9c7
4 changed files with 358 additions and 353 deletions
@@ -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 *