页面程序:
<Window x:Class="WpfDataGrid.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<RoutedUICommand x:Key="btnClick" Text="Button Click"/>
</Window.Resources>
<Window.InputBindings>
<KeyBinding Gesture="Ctrl+F" Key="F" Command="{StaticResource btnClick}"/>
</Window.InputBindings>
<Window.CommandBindings>
<CommandBinding Command="{StaticResource btnClick}