WPF给button加快捷键

时间:2025-04-09 08:53:26
<> <RoutedUICommand x:Key="ClickCommand" Text="Text" /> </> <> <CommandBinding Command="{StaticResource ClickCommand}" Executed="ClickHandler" /> </> <> <KeyBinding Key="C" Modifiers="Ctrl" Command="{StaticResource ClickCommand}" /> </> <Grid> <Button Content="Click here" Command="{StaticResource ClickCommand}"/> </Grid>