public MainWindow()
 {
    CommandManager.AddExecutedHandler(this, ExecuteHandler);
 }

 void ExecuteHandler(object sender, ExecutedRoutedEventArgs e)
 {
 }

错误1参数2:无法从“method group”转换为“system.delegate”

最佳答案

我想有多个签名不同的执行者。只需将处理程序转换为您想要的版本:

CommandManager.AddExecuteHandler(this, (Action<object,ExecutedRoutedEventArgs>)ExecuteHandler);

10-07 14:56