From ee44b4c2d4c9b4fad7aa2473d1223961b704e413 Mon Sep 17 00:00:00 2001 From: Sparrkle Date: Fri, 16 Sep 2022 11:21:09 +0900 Subject: [PATCH] Modified different way. fixed a bug not triggered while the backspace was pressed. --- Flow.Launcher/MainWindow.xaml | 2 +- Flow.Launcher/MainWindow.xaml.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index a3ea9c831..bd02b560a 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -173,7 +173,7 @@ Background="Transparent" PreviewDragOver="OnPreviewDragOver" Style="{DynamicResource QueryBoxStyle}" - Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=Explicit}" + Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" PreviewKeyUp="QueryTextBox_KeyUp" Visibility="Visible"> diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 20bfa0d62..258019457 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -560,7 +560,8 @@ namespace Flow.Launcher private void QueryTextBox_KeyUp(object sender, KeyEventArgs e) { - _viewModel.ChangeQueryText(QueryTextBox.Text); + if(_viewModel.QueryText != QueryTextBox.Text) + _viewModel.QueryText = QueryTextBox.Text; } } }