private void RenameDialogKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { RenameDialog.OkButtonClick(null, null); } if (e.Key == Key.Escape) { RenameDialog.CancelButtonClick(null, null); } }