diff --git a/FFUDevelopment/BuildFFUVM_UI.ps1 b/FFUDevelopment/BuildFFUVM_UI.ps1 index 04a2ab1..be8c4ae 100644 --- a/FFUDevelopment/BuildFFUVM_UI.ps1 +++ b/FFUDevelopment/BuildFFUVM_UI.ps1 @@ -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) diff --git a/FFUDevelopment/FFUUI.Core/FFUUI.Core.Initialize.psm1 b/FFUDevelopment/FFUUI.Core/FFUUI.Core.Initialize.psm1 index c50dfe1..ef49c81 100644 --- a/FFUDevelopment/FFUUI.Core/FFUUI.Core.Initialize.psm1 +++ b/FFUDevelopment/FFUUI.Core/FFUUI.Core.Initialize.psm1 @@ -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 *