Fixed Query Textbox Binding event

This commit is contained in:
Sparrkle 2022-09-14 17:50:42 +09:00
parent c81dd32d99
commit 5715dcd946
2 changed files with 11 additions and 3 deletions

View file

@ -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">
<TextBox.CommandBindings>
<CommandBinding Command="ApplicationCommands.Copy" Executed="OnCopy" />

View file

@ -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();
}
}
}
}