Created
January 9, 2018 15:14
-
-
Save kevingosse/451051b35471488f638ce3d38e4a00be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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