QueryWindow: Minor improvements

This commit is contained in:
2024-03-12 18:23:38 +01:00
parent 2a3a69d96f
commit 239b8a9091
3 changed files with 35 additions and 9 deletions

View File

@ -6,14 +6,26 @@ using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
namespace Elwig.Windows {
public partial class QueryWindow : Window {
private ICommand? _enterCommand;
public ICommand EnterCommand => _enterCommand ??= new ActionCommand(async () => {
await ExecuteQuery();
});
public QueryWindow() {
InitializeComponent();
}
private async void QueryButton_Click(object sender, RoutedEventArgs evt) {
await ExecuteQuery();
}
private async Task ExecuteQuery() {
try {
await ExecuteQuery(QueryInput.Text);
} catch (Exception e) {