QueryWindow: Minor improvements
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user