Skip to content

Instantly share code, notes, and snippets.

@kevingosse
Created January 9, 2018 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevingosse/451051b35471488f638ce3d38e4a00be to your computer and use it in GitHub Desktop.
Save kevingosse/451051b35471488f638ce3d38e4a00be to your computer and use it in GitHub Desktop.
private async void CommandTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Return)
{
var textBox = (TextBox)sender;
if (string.IsNullOrWhiteSpace(textBox.Text))
{
return;
}
var command = textBox.Text;
textBox.Text = string.Empty;
await ExecuteCommand(command);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment