Guest User

Untitled

a guest
Jan 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. private async void CommandTextBox_KeyDown(object sender, KeyEventArgs e)
  2. {
  3. if (e.Key == Key.Return)
  4. {
  5. var textBox = (TextBox)sender;
  6.  
  7. if (string.IsNullOrWhiteSpace(textBox.Text))
  8. {
  9. return;
  10. }
  11.  
  12. var command = textBox.Text;
  13.  
  14. textBox.Text = string.Empty;
  15.  
  16. await ExecuteCommand(command);
  17. }
  18. }
Add Comment
Please, Sign In to add comment