Skip to content

Commit 1546f63

Browse files
authored
Merge pull request #1380 from Sparrkle/QueryTextboxNotify
Fixed QueryTextbox Binding event
2 parents 8e05f31 + 69feaba commit 1546f63

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Flow.Launcher/MainWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@
174174
PreviewDragOver="OnPreviewDragOver"
175175
Style="{DynamicResource QueryBoxStyle}"
176176
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
177+
PreviewKeyUp="QueryTextBox_KeyUp"
177178
Visibility="Visible">
178179
<TextBox.CommandBindings>
179180
<CommandBinding Command="ApplicationCommands.Copy" Executed="OnCopy" />

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 13 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,8 @@
2020
using System.Windows.Media;
2121
using Flow.Launcher.Infrastructure.Hotkey;
2222
using Flow.Launcher.Plugin.SharedCommands;
23+
using System.Windows.Data;
24+
using System.Diagnostics;
2325

2426
namespace Flow.Launcher
2527
{
@@ -555,5 +557,14 @@ public void InitializeColorScheme()
555557
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Dark;
556558
}
557559
}
560+
561+
private void QueryTextBox_KeyUp(object sender, KeyEventArgs e)
562+
{
563+
if(_viewModel.QueryText != QueryTextBox.Text)
564+
{
565+
BindingExpression be = QueryTextBox.GetBindingExpression(System.Windows.Controls.TextBox.TextProperty);
566+
be.UpdateSource();
567+
}
568+
}
558569
}
559-
}
570+
}

0 commit comments

Comments
 (0)