Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void MyTextBox_KeyUp(object sender, KeyEventArgs e)
- {
- if (e.Key == Key.Enter) SomeButton_Click(this, null);
- }
- private void SomeButton_Click(object sender, RoutedEventArgs e)
- {
- ICommand cmd = SomeButton.Command;
- if (cmd.CanExecute(null))
- {
- cmd.Execute(null);
- }
- }
Add Comment
Please, Sign In to add comment