Извините, я думаю, что это фактический ответ на ваш вопрос:
Button b = new Button();
b.Command = ApplicationCommands.Copy;
List<string> gestures = new List<string>();
if (b.Command is RoutedCommand)
{
RoutedCommand command = (b.Command as RoutedCommand);
foreach (InputGesture gesture in command.InputGestures)
{
if (gesture is KeyGesture)
gestures.Add((gesture as KeyGesture).DisplayString);
}
}
Если причина, по которой вы хотите получить, заключается в том, чтобы отобразить ее в содержимом кнопки, вы всегда можете сделать это:
<Button Command="ApplicationCommands.New" Content="{Binding RelativeSource={RelativeSource Self}, Path=Command.Text}"></Button>
Это будет иметь кнопку сказать "Новый".