From 5715dcd946442d36fe8b8d5a95190512e124da6b Mon Sep 17 00:00:00 2001 From: Sparrkle Date: Wed, 14 Sep 2022 17:50:42 +0900 Subject: [PATCH] Fixed Query Textbox Binding event --- Flow.Launcher/MainWindow.xaml | 3 ++- Flow.Launcher/MainWindow.xaml.cs | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 714fcc53f..a3ea9c831 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -173,7 +173,8 @@ Background="Transparent" PreviewDragOver="OnPreviewDragOver" Style="{DynamicResource QueryBoxStyle}" - Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" + Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=Explicit}" + PreviewKeyUp="QueryTextBox_KeyUp" Visibility="Visible"> diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 2b7db38cf..a4d02fb50 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Threading.Tasks; using System.Windows; @@ -20,6 +20,7 @@ using Flow.Launcher.Infrastructure; using System.Windows.Media; using Flow.Launcher.Infrastructure.Hotkey; using Flow.Launcher.Plugin.SharedCommands; +using System.Windows.Data; namespace Flow.Launcher { @@ -555,5 +556,11 @@ namespace Flow.Launcher ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Dark; } } + + private void QueryTextBox_KeyUp(object sender, KeyEventArgs e) + { + BindingExpression be = QueryTextBox.GetBindingExpression(System.Windows.Controls.TextBox.TextProperty); + be.UpdateSource(); + } } -} \ No newline at end of file +}