Skip to content

Commit 5715dcd

Browse files
committed
Fixed Query Textbox Binding event
1 parent c81dd32 commit 5715dcd

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Flow.Launcher/MainWindow.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@
173173
Background="Transparent"
174174
PreviewDragOver="OnPreviewDragOver"
175175
Style="{DynamicResource QueryBoxStyle}"
176-
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
176+
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=Explicit}"
177+
PreviewKeyUp="QueryTextBox_KeyUp"
177178
Visibility="Visible">
178179
<TextBox.CommandBindings>
179180
<CommandBinding Command="ApplicationCommands.Copy" Executed="OnCopy" />

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.ComponentModel;
33
using System.Threading.Tasks;
44
using System.Windows;
@@ -20,6 +20,7 @@
2020
using System.Windows.Media;
2121
using Flow.Launcher.Infrastructure.Hotkey;
2222
using Flow.Launcher.Plugin.SharedCommands;
23+
using System.Windows.Data;
2324

2425
namespace Flow.Launcher
2526
{
@@ -555,5 +556,11 @@ public void InitializeColorScheme()
555556
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Dark;
556557
}
557558
}
559+
560+
private void QueryTextBox_KeyUp(object sender, KeyEventArgs e)
561+
{
562+
BindingExpression be = QueryTextBox.GetBindingExpression(System.Windows.Controls.TextBox.TextProperty);
563+
be.UpdateSource();
564+
}
558565
}
559-
}
566+
}

0 commit comments

Comments
 (0)