mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Refactor USB drive detection event handler
Moves the click event handler for detecting USB drives from the main UI script to the dedicated core handlers module. This change centralizes UI logic, improving code organization and maintainability.
This commit is contained in:
@@ -194,16 +194,6 @@ $window.Add_Loaded({
|
||||
$script:uiState.Controls.chkLatestCU.IsEnabled = -not $script:uiState.Controls.chkPreviewCU.IsChecked
|
||||
|
||||
# USB Drive Detection/Selection logic (Keep existing logic)
|
||||
$script:uiState.Controls.btnCheckUSBDrives.Add_Click({
|
||||
$script:uiState.Controls.lstUSBDrives.Items.Clear()
|
||||
$usbDrives = Get-USBDrives
|
||||
foreach ($drive in $usbDrives) {
|
||||
$script:uiState.Controls.lstUSBDrives.Items.Add([PSCustomObject]$drive)
|
||||
}
|
||||
if ($script:uiState.Controls.lstUSBDrives.Items.Count -gt 0) {
|
||||
$script:uiState.Controls.lstUSBDrives.SelectedIndex = 0
|
||||
}
|
||||
})
|
||||
$script:uiState.Controls.chkSelectAllUSBDrives.Add_Checked({
|
||||
foreach ($item in $script:uiState.Controls.lstUSBDrives.Items) { $item.IsSelected = $true }
|
||||
$script:uiState.Controls.lstUSBDrives.Items.Refresh()
|
||||
|
||||
Reference in New Issue
Block a user