on winforms, event must be cancelled to prevent default text box handler from spitting out an annoying 'ding' sound, also we have to manually close the window too

This commit is contained in:
Michael Becker 2020-01-25 03:28:31 -05:00
parent afd8ef84c1
commit bdae99298b
No known key found for this signature in database
GPG Key ID: 506F54899E2BFED7

View File

@ -131,6 +131,7 @@ namespace UniversalEditor.UserInterface.Dialogs
{
if (e.Key == KeyboardKey.Enter)
{
e.Cancel = true;
if (lv.SelectedRows.Count != 1) return;
SelectedObject = lv.SelectedRows[0].GetExtraData<TRef>("TRef")?.Create();
@ -140,8 +141,10 @@ namespace UniversalEditor.UserInterface.Dialogs
}
else if (e.Key == KeyboardKey.Escape)
{
e.Cancel = true;
// already handled by GTK? but what about other platforms
// Close();
Close();
}
}