Refresh List on focus lost or enter

This commit is contained in:
Hongtao Zhang 2022-02-06 17:50:02 -06:00
parent dff67ac670
commit 455b2405e6
2 changed files with 9 additions and 2 deletions

View file

@ -927,7 +927,8 @@
FontSize="14" FontSize="14"
Text="" Text=""
TextAlignment="Left" TextAlignment="Left"
TextChanged="OnPluginSearchTextChanged"> LostFocus="RefreshPluginListEventHandler"
KeyDown="PluginFilterTxb_OnKeyDown">
<TextBox.Style> <TextBox.Style>
<Style BasedOn="{StaticResource DefaultTextBoxStyle}" TargetType="TextBox"> <Style BasedOn="{StaticResource DefaultTextBoxStyle}" TargetType="TextBox">
<Style.Resources> <Style.Resources>

View file

@ -21,6 +21,7 @@ using System.Windows.Interop;
using System.Windows.Navigation; using System.Windows.Navigation;
using Button = System.Windows.Controls.Button; using Button = System.Windows.Controls.Button;
using Control = System.Windows.Controls.Control; using Control = System.Windows.Controls.Control;
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
using MessageBox = System.Windows.MessageBox; using MessageBox = System.Windows.MessageBox;
using TextBox = System.Windows.Controls.TextBox; using TextBox = System.Windows.Controls.TextBox;
using ThemeManager = ModernWpf.ThemeManager; using ThemeManager = ModernWpf.ThemeManager;
@ -392,9 +393,14 @@ namespace Flow.Launcher
return false; return false;
} }
private void OnPluginSearchTextChanged(object sender, TextChangedEventArgs e) private void RefreshPluginListEventHandler(object sender, RoutedEventArgs e)
{ {
pluginListView.Refresh(); pluginListView.Refresh();
} }
private void PluginFilterTxb_OnKeyDown(object sender, KeyEventArgs e)
{
if(e.Key == Key.Enter)
pluginListView.Refresh();
}
} }
} }