mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Refactor: Centralize UI event handlers and abstract list clearing
Moves UI event handling logic from the main script into a dedicated core module to improve separation of concerns. Introduces a new shared function, `Clear-ListViewContent`, to consolidate duplicated logic for clearing list views. This generic function handles user confirmation, data source clearing, and UI updates for multiple tabs, significantly reducing code redundancy.
This commit is contained in:
@@ -686,6 +686,19 @@ function Start-WingetAppDownloadTask {
|
||||
return $returnObject
|
||||
}
|
||||
|
||||
function Update-WingetVersionFields {
|
||||
param(
|
||||
[psobject]$State,
|
||||
[string]$wingetText,
|
||||
[string]$moduleText
|
||||
)
|
||||
$State.Window.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Normal, [Action] {
|
||||
$State.Controls.txtWingetVersion.Text = $wingetText
|
||||
$State.Controls.txtWingetModuleVersion.Text = $moduleText
|
||||
[System.Windows.Forms.Application]::DoEvents()
|
||||
})
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# SECTION: Module Export
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user