mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Refactors model filter event handling to core module
Moves the `TextChanged` event handler for the driver model filter from the UI script to the core `Register-EventHandlers` function. This change centralizes the logic and makes the handler more generic by retrieving the UI state from the window's tag instead of relying on a global variable.
This commit is contained in:
@@ -577,6 +577,12 @@ function Register-EventHandlers {
|
||||
$eventSource.IsEnabled = $true
|
||||
}
|
||||
})
|
||||
$State.Controls.txtModelFilter.Add_TextChanged({
|
||||
param($sourceObject, $textChangedEventArgs)
|
||||
$window = [System.Windows.Window]::GetWindow($sourceObject)
|
||||
$localState = $window.Tag
|
||||
Search-DriverModels -filterText $localState.Controls.txtModelFilter.Text -State $localState
|
||||
})
|
||||
}
|
||||
|
||||
Export-ModuleMember -Function *
|
||||
|
||||
Reference in New Issue
Block a user