以前、私はcmdCopy_Executedが非静的関数ですが、私がいるCommandBindingが静的であるCommandClassをRegisterClassCommandBindingを使用してコントロールに追加するかどうかに違いはありますか?
static MyControl()
{
CommandBinding binding =
new CommandBinding(ApplicationCommands.Save, CommandHandler);
CommandManager.RegisterClassCommandBinding(typeof(MyControl), binding);
}
private static void CommandHandler(object target, ExecutedRoutedEventArgs e)
{
MessageBox.Show("Command Handled!");
}
を使用して人々を見てきました
this.CommandBindings.Add(
new CommandBinding(ApplicationCommands.Copy, this.cmdCopy_Executed, this.cmdCopy_CanExecute))
を使用していました。 1つは別のものより優先されますか?