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:
rbalsleyMSFT
2025-06-17 16:11:18 -07:00
parent ab0b92ad5c
commit 07306ff209
2 changed files with 6 additions and 4 deletions
-4
View File
@@ -169,10 +169,6 @@ $window.Add_Loaded({
$script:uiState.Controls.spModelFilterSection.Visibility = 'Collapsed'
$script:uiState.Controls.lstDriverModels.Visibility = 'Collapsed'
$script:uiState.Controls.spDriverActionButtons.Visibility = 'Collapsed'
$script:uiState.Controls.txtModelFilter.Add_TextChanged({
param($sourceObject, $textChangedEventArgs)
Search-DriverModels -filterText $script:uiState.Controls.txtModelFilter.Text -State $script:uiState
})
$script:uiState.Controls.btnDownloadSelectedDrivers.Add_Click({
param($buttonSender, $clickEventArgs)